Fix termination of fetching chat data
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
"""アーカイブ済みチャットはライブチャットと構造が異なっているため、以下の行により
|
||||
|
||||
Reference in New Issue
Block a user