diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-03-27 14:04:20 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-03-27 14:04:20 +0530 |
commit | 18e49408259fa26c4d6f89f6d7ffdce59888d151 (patch) | |
tree | 2bdbd124be1ecf2b48489441cea259950253cff6 | |
parent | c0b6e5c74d59d5260441ceaeb5dac3626780b31b (diff) | |
download | hypervideo-pre-18e49408259fa26c4d6f89f6d7ffdce59888d151.tar.lz hypervideo-pre-18e49408259fa26c4d6f89f6d7ffdce59888d151.tar.xz hypervideo-pre-18e49408259fa26c4d6f89f6d7ffdce59888d151.zip |
[youtube] Add extractor-arg to skip auto-translated subs
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | yt_dlp/extractor/youtube.py | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -1656,7 +1656,7 @@ Some extractors accept additional arguments which can be passed using `--extract 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 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 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. |