mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00:00
Merge pull request #137 from nsapa/fix_subtitle
Fix issue triggered by tubeup
This commit is contained in:
commit
34861f1c96
|
@ -364,8 +364,10 @@ 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 = 0
|
||||||
|
if type(self.params.get('sleep_interval_subtitles')) is int:
|
||||||
sleep_interval_sub = self.params.get('sleep_interval_subtitles')
|
sleep_interval_sub = self.params.get('sleep_interval_subtitles')
|
||||||
|
if sleep_interval_sub > 0:
|
||||||
self.to_screen(
|
self.to_screen(
|
||||||
'[download] Sleeping %s seconds...' % (
|
'[download] Sleeping %s seconds...' % (
|
||||||
sleep_interval_sub))
|
sleep_interval_sub))
|
||||||
|
|
|
@ -82,7 +82,10 @@ def parse_yt_initial_data(data):
|
||||||
offset = int(replay_chat_item_action['videoOffsetTimeMsec'])
|
offset = int(replay_chat_item_action['videoOffsetTimeMsec'])
|
||||||
processed_fragment.extend(
|
processed_fragment.extend(
|
||||||
json.dumps(action, ensure_ascii=False).encode('utf-8') + b'\n')
|
json.dumps(action, ensure_ascii=False).encode('utf-8') + b'\n')
|
||||||
|
try:
|
||||||
continuation_id = live_chat_continuation['continuations'][0]['liveChatReplayContinuationData']['continuation']
|
continuation_id = live_chat_continuation['continuations'][0]['liveChatReplayContinuationData']['continuation']
|
||||||
|
except KeyError:
|
||||||
|
continuation_id = None
|
||||||
|
|
||||||
self._append_fragment(ctx, processed_fragment)
|
self._append_fragment(ctx, processed_fragment)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue