diff --git a/youtube_dlc/downloader/common.py b/youtube_dlc/downloader/common.py index c65500d613..7d303be1cf 100644 --- a/youtube_dlc/downloader/common.py +++ b/youtube_dlc/downloader/common.py @@ -364,8 +364,10 @@ def download(self, filename, info_dict, subtitle=False): 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 4932dd9c52..b333afa5bd 100644 --- a/youtube_dlc/downloader/youtube_live_chat.py +++ b/youtube_dlc/downloader/youtube_live_chat.py @@ -82,7 +82,10 @@ def parse_yt_initial_data(data): 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)