From 6eb848f1c9dea5a858d98f8f29b4186fbe1d7397 Mon Sep 17 00:00:00 2001 From: taizan-hokuto <55448286+taizan-hokuto@users.noreply.github.com> Date: Sun, 31 May 2020 19:43:09 +0900 Subject: [PATCH] Modify checking timestamp --- pytchat/paramgen/arcparam.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pytchat/paramgen/arcparam.py b/pytchat/paramgen/arcparam.py index 7da23f3..9ea6be2 100644 --- a/pytchat/paramgen/arcparam.py +++ b/pytchat/paramgen/arcparam.py @@ -22,6 +22,7 @@ def _gen_vid(video_id) -> str: def _build(video_id, seektime, topchat_only) -> str: chattype = 1 + timestamp = 0 if topchat_only: chattype = 4 @@ -29,12 +30,13 @@ def _build(video_id, seektime, topchat_only) -> str: if seektime < 0: fetch_before_start = 1 elif seektime == 0: - seektime = 1/1000000 - + timestamp = 1 + else: + timestamp = int(seektime*1000000) continuation = Continuation() entity = continuation.entity entity.header = _gen_vid(video_id) - entity.timestamp = int(seektime*1000000) + entity.timestamp = timestamp entity.s6 = 0 entity.s7 = 0 entity.s8 = fetch_before_start @@ -47,7 +49,7 @@ def _build(video_id, seektime, topchat_only) -> str: base64.urlsafe_b64encode(continuation.SerializeToString()).decode()) -def getparam(video_id, seektime=0, topchat_only=False) -> str: +def getparam(video_id, seektime=-1, topchat_only=False) -> str: ''' Parameter ---------