Fix termination of fetching chat data

This commit is contained in:
taizan-hokuto
2019-12-30 17:10:34 +09:00
parent 7af92f14c0
commit ce96d94e23
7 changed files with 38 additions and 36 deletions

View File

@@ -59,7 +59,7 @@ class Parser:
if metadata is None:
unknown = list(cont.keys())[0]
if unknown:
logger.error(f"Received unknown continuation type:{unknown}")
logger.debug(f"Received unknown continuation type:{unknown}")
metadata = cont.get(unknown)
metadata.setdefault('timeoutMs', 10000)
chatdata = contents['liveChatContinuation'].get('actions')

View File

@@ -9,7 +9,6 @@ from .. exceptions import (
logger = config.logger(__name__)
class Parser:
def parse(self, jsn):
"""
@@ -53,12 +52,13 @@ class Parser:
metadata = cont.get('liveChatReplayContinuationData')
if metadata is None:
unknown = list(cont.keys())[0]
if unknown:
if unknown != "playerSeekContinuationData":
logger.debug(f"Received unknown continuation type:{unknown}")
metadata = cont.get(unknown)
actions = contents['liveChatContinuation'].get('actions')
if actions is None:
raise NoContentsException('チャットデータを取得できませんでした。')
#後続のチャットデータなし
return {"continuation":None,"timeout":0,"chatdata":[]}
interval = self.get_interval(actions)
metadata.setdefault("timeoutMs",interval)
"""アーカイブ済みチャットはライブチャットと構造が異なっているため、以下の行により