Fix process of fetching archived chat

This commit is contained in:
taizan-hokouto
2021-01-09 22:09:31 +09:00
parent b7f2967a4f
commit 78fbe97b66
9 changed files with 48 additions and 88 deletions

View File

@@ -28,7 +28,7 @@ class Parser:
def get_contents(self, jsn):
if jsn is None:
self.raise_exception(exceptions.IllegalFunctionCall('Called with none JSON object.'))
if jsn.get("error") or jsn.get("responseContext", {}).get("errors"):
if jsn.get("responseContext", {}).get("errors"):
raise exceptions.ResponseContextError(
'The video_id would be wrong, or video is deleted or private.')
contents = jsn.get('continuationContents')