mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[core] sleep-subtitles fix
This commit is contained in:
parent
ae306df7e0
commit
31108ce946
2 changed files with 7 additions and 6 deletions
|
@ -364,10 +364,11 @@ def download(self, filename, info_dict, subtitle=False):
|
||||||
else '%.2f' % sleep_interval))
|
else '%.2f' % sleep_interval))
|
||||||
time.sleep(sleep_interval)
|
time.sleep(sleep_interval)
|
||||||
else:
|
else:
|
||||||
|
if self.params.get('sleep_interval_subtitles') > 0:
|
||||||
sleep_interval_sub = self.params.get('sleep_interval_subtitles')
|
sleep_interval_sub = self.params.get('sleep_interval_subtitles')
|
||||||
self.to_screen(
|
self.to_screen(
|
||||||
'[download] Sleeping %s seconds...' % (
|
'[download] Sleeping %s seconds...' % (
|
||||||
int(sleep_interval_sub)))
|
sleep_interval_sub))
|
||||||
time.sleep(sleep_interval_sub)
|
time.sleep(sleep_interval_sub)
|
||||||
return self.real_download(filename, info_dict)
|
return self.real_download(filename, info_dict)
|
||||||
|
|
||||||
|
|
|
@ -582,7 +582,7 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
|
||||||
'along with --min-sleep-interval.'))
|
'along with --min-sleep-interval.'))
|
||||||
workarounds.add_option(
|
workarounds.add_option(
|
||||||
'--sleep-subtitles',
|
'--sleep-subtitles',
|
||||||
dest='sleep_interval_subtitles', action='store_true', default=0,
|
dest='sleep_interval_subtitles', default=0, type=int,
|
||||||
help='Enforce sleep interval on subtitles as well')
|
help='Enforce sleep interval on subtitles as well')
|
||||||
|
|
||||||
verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')
|
verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')
|
||||||
|
|
Loading…
Reference in a new issue