diff --git a/youtube_transcript_api/_api.py b/youtube_transcript_api/_api.py index c5e835d..99f7d53 100644 --- a/youtube_transcript_api/_api.py +++ b/youtube_transcript_api/_api.py @@ -61,6 +61,8 @@ class YouTubeTranscriptApi(object): :type proxies: {'http': str, 'https': str} - http://docs.python-requests.org/en/master/user/advanced/#proxies :param cookies: a string of the path to a text file containing youtube authorization cookies :type cookies: str + :param preserve_formatting: whether to keep select HTML text formatting + :type preserve_formatting: bool :return: the list of available transcripts :rtype TranscriptList: """ @@ -126,6 +128,8 @@ class YouTubeTranscriptApi(object): :type proxies: {'http': str, 'https': str} - http://docs.python-requests.org/en/master/user/advanced/#proxies :param cookies: a string of the path to a text file containing youtube authorization cookies :type cookies: str + :param preserve_formatting: whether to keep select HTML text formatting + :type preserve_formatting: bool :return: a list of dictionaries containing the 'text', 'start' and 'duration' keys :rtype [{'text': str, 'start': float, 'end': float}]: """ diff --git a/youtube_transcript_api/_transcripts.py b/youtube_transcript_api/_transcripts.py index a1b2b5c..59d2f4c 100644 --- a/youtube_transcript_api/_transcripts.py +++ b/youtube_transcript_api/_transcripts.py @@ -137,6 +137,8 @@ class TranscriptList(object): :type video_id: str :param captions_json: the JSON parsed from the YouTube pages static HTML :type captions_json: dict + :param preserve_formatting: whether to keep select HTML text formatting + :type preserve_formatting: bool :return: the created TranscriptList :rtype TranscriptList: """ @@ -279,7 +281,8 @@ class Transcript(object): :param language_code: :param is_generated: :param translation_languages: - :param preserve_formatting: whether to keep select HTMl text formatting + :param preserve_formatting: whether to keep select HTML text formatting + :type preserve_formatting: bool """ self._http_client = http_client self.video_id = video_id