add object to classes, fixes bugfix/ISSUE-75

This commit is contained in:
Chris Howell 2021-03-08 04:04:19 -08:00
parent cf0647f91f
commit 35dca89ef2
3 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ from ._errors import (
CookiesInvalid CookiesInvalid
) )
class YouTubeTranscriptApi(): class YouTubeTranscriptApi(object):
@classmethod @classmethod
def list_transcripts(cls, video_id, proxies=None, cookies=None): def list_transcripts(cls, video_id, proxies=None, cookies=None):
""" """

View File

@ -7,7 +7,7 @@ import argparse
from ._api import YouTubeTranscriptApi from ._api import YouTubeTranscriptApi
class YouTubeTranscriptCli(): class YouTubeTranscriptCli(object):
def __init__(self, args): def __init__(self, args):
self._args = args self._args = args

View File

@ -24,7 +24,7 @@ from ._errors import (
from ._settings import WATCH_URL from ._settings import WATCH_URL
class TranscriptListFetcher(): class TranscriptListFetcher(object):
def __init__(self, http_client): def __init__(self, http_client):
self._http_client = http_client self._http_client = http_client
@ -63,7 +63,7 @@ class TranscriptListFetcher():
) )
class TranscriptList(): class TranscriptList(object):
""" """
This object represents a list of transcripts. It can be iterated over to list all transcripts which are available This object represents a list of transcripts. It can be iterated over to list all transcripts which are available
for a given YouTube video. Also it provides functionality to search for a transcript in a given language. for a given YouTube video. Also it provides functionality to search for a transcript in a given language.
@ -222,7 +222,7 @@ class TranscriptList():
return description if description else 'None' return description if description else 'None'
class Transcript(): class Transcript(object):
def __init__(self, http_client, video_id, url, language, language_code, is_generated, translation_languages): def __init__(self, http_client, video_id, url, language, language_code, is_generated, translation_languages):
""" """
You probably don't want to initialize this directly. Usually you'll access Transcript objects using a You probably don't want to initialize this directly. Usually you'll access Transcript objects using a
@ -290,7 +290,7 @@ class Transcript():
) )
class _TranscriptParser(): class _TranscriptParser(object):
HTML_TAG_REGEX = re.compile(r'<[^>]*>', re.IGNORECASE) HTML_TAG_REGEX = re.compile(r'<[^>]*>', re.IGNORECASE)
def parse(self, plain_data): def parse(self, plain_data):