From abb7565e3a1a9fcc9a35b8df9dda2d0db7f544ad Mon Sep 17 00:00:00 2001 From: taizan-hokuto <55448286+taizan-hokuto@users.noreply.github.com> Date: Sun, 9 Feb 2020 21:58:09 +0900 Subject: [PATCH] Implement postprocessing --- pytchat/tool/downloader.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pytchat/tool/downloader.py b/pytchat/tool/downloader.py index 37e729d..07a4178 100644 --- a/pytchat/tool/downloader.py +++ b/pytchat/tool/downloader.py @@ -77,4 +77,10 @@ def download(video_id, div = 1, callback = None, processor = None): if duration == 0: print("video is live.") return [] - return Downloader(video_id, duration, div, callback).download() + data = Downloader(video_id, duration, div, callback).download() + if processor is None: + return data + return processor.process( + [{'video_id':None,'timeout':1,'chatdata' : [action + ["replayChatItemAction"]["actions"][0] for action in data]}] + )