diff --git a/README.md b/README.md index a25f5f4..b2ae4a8 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,12 @@ This will return a list of dictionaries looking somewhat like this: # ... ] ``` +### Translate transcript -You can add the `languages` param if you want to make sure the transcripts are retrieved in your desired language (it defaults to english). You can also add `preserve_formatting=True` if you'd like to keep HTML formatting elements such as `` (italics) and `` (bold). +You can add the `languages` param if you want to make sure the transcripts are retrieved in your desired language (it defaults to english). ```python -YouTubeTranscriptApi.get_transcripts(video_ids, languages=['de', 'en'], preserve_formatting=True) +YouTubeTranscriptApi.get_transcripts(video_ids, languages=['de', 'en']) ``` It's a list of language codes in a descending priority. In this example it will first try to fetch the german transcript (`'de'`) and then fetch the english transcript (`'en'`) if it fails to do so. If you want to find out which languages are available first, [have a look at `list_transcripts()`](#list-available-transcripts) @@ -65,6 +66,14 @@ YouTubeTranscriptApi.get_transcripts(video_ids, languages=['de', 'en']) `languages` also is optional here. +### Preserve formatting + +You can also add `preserve_formatting=True` if you'd like to keep HTML formatting elements such as `` (italics) and `` (bold). + +```python +YouTubeTranscriptApi.get_transcripts(video_ids, languages=['de', 'en'], preserve_formatting=True) +``` + ### List available transcripts If you want to list all transcripts which are available for a given video you can call: