From 214a3d2be378959e9c9c2990d0a11c86c48a9433 Mon Sep 17 00:00:00 2001 From: taizan-hokuto <55448286+taizan-hokuto@users.noreply.github.com> Date: Mon, 27 Jan 2020 00:15:46 +0900 Subject: [PATCH] Change function to inline --- pytchat/tool/downloader.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pytchat/tool/downloader.py b/pytchat/tool/downloader.py index 48030c4..1e01471 100644 --- a/pytchat/tool/downloader.py +++ b/pytchat/tool/downloader.py @@ -162,10 +162,6 @@ class Downloader: if (block.temp_last != -1 and block.last > block.temp_last): return - - def get_last_offset(actions): - return parser.get_offset(actions[-1]) - continuation = block.continuation while continuation: url = f"{REPLAY_URL}{quote(continuation)}&pbj=1" @@ -174,7 +170,7 @@ class Downloader: continuation, actions = parser.parse(json.loads(text)) if actions: block.chat_data.extend(actions) - last = get_last_offset(actions) + last = parser.get_offset(actions[-1]) first = parser.get_offset(actions[0]) if self.callback: self.callback(actions,last-first)