aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/__init__.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-08-05 23:30:53 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-08-06 00:55:04 +0530
commitb51d2ae3cae121de084460f1260d5d644a566338 (patch)
tree847d65d3f4ba0d1488b8fcf9c035f6a26c337c06 /yt_dlp/__init__.py
parentfee5f0c9098c708df7bb4510d56b81800b30ea50 (diff)
downloadhypervideo-pre-b51d2ae3cae121de084460f1260d5d644a566338.tar.lz
hypervideo-pre-b51d2ae3cae121de084460f1260d5d644a566338.tar.xz
hypervideo-pre-b51d2ae3cae121de084460f1260d5d644a566338.zip
Add compat-option `no-keep-subs`
Closes #630
Diffstat (limited to 'yt_dlp/__init__.py')
-rw-r--r--yt_dlp/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py
index fb0f46a4a..532d004c3 100644
--- a/yt_dlp/__init__.py
+++ b/yt_dlp/__init__.py
@@ -280,7 +280,7 @@ def _real_main(argv=None):
'filename', 'format-sort', 'abort-on-error', 'format-spec', 'no-playlist-metafiles',
'multistreams', 'no-live-chat', 'playlist-index', 'list-formats', 'no-direct-merge',
'no-youtube-channel-redirect', 'no-youtube-unavailable-videos', 'no-attach-info-json',
- 'embed-thumbnail-atomicparsley', 'seperate-video-versions', 'no-clean-infojson',
+ 'embed-thumbnail-atomicparsley', 'seperate-video-versions', 'no-clean-infojson', 'no-keep-subs',
]
compat_opts = parse_compat_opts()
@@ -458,13 +458,13 @@ def _real_main(argv=None):
if opts.addmetadata:
postprocessors.append({'key': 'FFmpegMetadata'})
if opts.embedsubtitles:
- already_have_subtitle = opts.writesubtitles
+ already_have_subtitle = opts.writesubtitles and 'no-keep-subs' not in compat_opts
postprocessors.append({
'key': 'FFmpegEmbedSubtitle',
# already_have_subtitle = True prevents the file from being deleted after embedding
'already_have_subtitle': already_have_subtitle
})
- if not already_have_subtitle:
+ if not opts.writeautomaticsub and 'no-keep-subs' not in compat_opts:
opts.writesubtitles = True
# --all-sub automatically sets --write-sub if --write-auto-sub is not given
# this was the old behaviour if only --all-sub was given.