From 18e49408259fa26c4d6f89f6d7ffdce59888d151 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 27 Mar 2022 14:04:20 +0530 Subject: [PATCH] [youtube] Add extractor-arg to skip auto-translated subs --- README.md | 2 +- yt_dlp/extractor/youtube.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c184d23c4..955a98557 100644 --- 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) diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index bd3a7d36b..1655f99e3 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -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.