add subtitle options only if any present
This commit is contained in:
parent
e67e85eefb
commit
0e800d0c0b
1 changed files with 4 additions and 3 deletions
|
@ -370,14 +370,11 @@ class GetYoutubeVideos:
|
||||||
'temp': '/tmp',
|
'temp': '/tmp',
|
||||||
'home': download_dir
|
'home': download_dir
|
||||||
},
|
},
|
||||||
'writesubtitles': True,
|
|
||||||
'writeautomaticsub': True,
|
'writeautomaticsub': True,
|
||||||
'writeannotations': True,
|
'writeannotations': True,
|
||||||
'write_all_thumbnails': False,
|
'write_all_thumbnails': False,
|
||||||
'writethumbnail': True,
|
'writethumbnail': True,
|
||||||
'writeinfojson': True,
|
'writeinfojson': True,
|
||||||
'subtitlesformat': 'srt',
|
|
||||||
'subtitleslangs': downloadable_subtitles,
|
|
||||||
'allow_multiple_audio_streams': True,
|
'allow_multiple_audio_streams': True,
|
||||||
'noprogress': True,
|
'noprogress': True,
|
||||||
'merge_output_format': 'mkv',
|
'merge_output_format': 'mkv',
|
||||||
|
@ -385,6 +382,10 @@ class GetYoutubeVideos:
|
||||||
'format': '248+ba',
|
'format': '248+ba',
|
||||||
# 'extractor_args': {'youtube': {'player-client': ['mweb']}}
|
# 'extractor_args': {'youtube': {'player-client': ['mweb']}}
|
||||||
}
|
}
|
||||||
|
if len(downloadable_subtitles) > 0:
|
||||||
|
ydl_opts['subtitleslangs'] = downloadable_subtitles
|
||||||
|
ydl_opts['subtitlesformat'] = 'srt'
|
||||||
|
ydl_opts['writesubtitles'] = True
|
||||||
if self.selected_proxy != '':
|
if self.selected_proxy != '':
|
||||||
ydl_opts['proxy'] = self.selected_proxy
|
ydl_opts['proxy'] = self.selected_proxy
|
||||||
download_result = 'starting'
|
download_result = 'starting'
|
||||||
|
|
Loading…
Reference in a new issue