aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom-Oliver Heidel <github@tom-oliver.eu>2020-11-11 00:02:09 +0100
committerGitHub <noreply@github.com>2020-11-11 00:02:09 +0100
commit34861f1c96ac6a648df290dfbede27ce4119c160 (patch)
tree837729f26ef4cd5751556499ada89b2653a0d463
parentd91fdaff03a9759aeac9ae9d7e5ee7f6ed2cf14f (diff)
parent8263104fe4f7aed96a1cc92be6b58cc219de876e (diff)
downloadhypervideo-pre-34861f1c96ac6a648df290dfbede27ce4119c160.tar.lz
hypervideo-pre-34861f1c96ac6a648df290dfbede27ce4119c160.tar.xz
hypervideo-pre-34861f1c96ac6a648df290dfbede27ce4119c160.zip
Merge pull request #137 from nsapa/fix_subtitle
Fix issue triggered by tubeup
-rw-r--r--youtube_dlc/downloader/common.py4
-rw-r--r--youtube_dlc/downloader/youtube_live_chat.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/youtube_dlc/downloader/common.py b/youtube_dlc/downloader/common.py
index c65500d61..7d303be1c 100644
--- a/youtube_dlc/downloader/common.py
+++ b/youtube_dlc/downloader/common.py
@@ -364,8 +364,10 @@ class FileDownloader(object):
else '%.2f' % sleep_interval))
time.sleep(sleep_interval)
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')
+ if sleep_interval_sub > 0:
self.to_screen(
'[download] Sleeping %s seconds...' % (
sleep_interval_sub))
diff --git a/youtube_dlc/downloader/youtube_live_chat.py b/youtube_dlc/downloader/youtube_live_chat.py
index 4932dd9c5..b333afa5b 100644
--- a/youtube_dlc/downloader/youtube_live_chat.py
+++ b/youtube_dlc/downloader/youtube_live_chat.py
@@ -82,7 +82,10 @@ class YoutubeLiveChatReplayFD(FragmentFD):
offset = int(replay_chat_item_action['videoOffsetTimeMsec'])
processed_fragment.extend(
json.dumps(action, ensure_ascii=False).encode('utf-8') + b'\n')
- continuation_id = live_chat_continuation['continuations'][0]['liveChatReplayContinuationData']['continuation']
+ try:
+ continuation_id = live_chat_continuation['continuations'][0]['liveChatReplayContinuationData']['continuation']
+ except KeyError:
+ continuation_id = None
self._append_fragment(ctx, processed_fragment)