]> jfr.im git - yt-dlp.git/commitdiff
[youtube] Add extractor-arg to skip auto-translated subs
authorpukkandan <redacted>
Sun, 27 Mar 2022 08:34:20 +0000 (14:04 +0530)
committerpukkandan <redacted>
Sun, 27 Mar 2022 08:34:20 +0000 (14:04 +0530)
README.md
yt_dlp/extractor/youtube.py

index c184d23c4fbbbf54201e0546c6fad575096378e5..955a9855772fcf3ba9f9a9e669729e4d8e55dcd3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1656,7 +1656,7 @@ # EXTRACTOR ARGUMENTS
 The following extractors use this feature:
 
 #### youtube
-* `skip`: `hls` or `dash` (or both) to skip download of the respective manifests
+* `skip`: One or more of `hls`, `dash` or `translated_subs` to skip extraction of the m3u8 manifests, dash manifests and auto-translated subtitles respectively
 * `player_client`: Clients to extract video data from. The main clients are `web`, `android`, `ios`, `mweb`. These also have `_music`, `_embedded`, `_agegate`, and `_creator` variants (Eg: `web_embedded`) (`mweb` has only `_agegate`). By default, `android,web` is used, but the agegate and creator variants are added as required for age-gated videos. Similarly the music variants are added for `music.youtube.com` urls. You can also use `all` to use all the clients, and `default` for the default clients.
 * `player_skip`: Skip some network requests that are generally needed for robust extraction. One or more of `configs` (skip client configs), `webpage` (skip initial webpage), `js` (skip js player). While these options can help reduce the number of requests needed or avoid some rate-limiting, they could cause some issues. See [#860](https://github.com/yt-dlp/yt-dlp/pull/860) for more details
 * `include_live_dash`: Include live dash formats even without `--live-from-start` (These formats don't download properly)
index bd3a7d36bbe778a4861b6d2c115bb8fd478b6896..1655f99e348a6fbba975d1bd8020a37b930f74e2 100644 (file)
@@ -3493,6 +3493,8 @@ def process_language(container, base_url, lang_code, sub_name, query):
                     if not trans_code:
                         continue
                     if caption_track.get('kind') != 'asr':
+                        if 'translated_subs' in self._configuration_arg('skip'):
+                            continue
                         trans_code += f'-{lang_code}'
                         trans_name += format_field(lang_name, template=' from %s')
                     # Add an "-orig" label to the original language so that it can be distinguished.