From 03ba285a16f60ea39295709424edf657da7b4969 Mon Sep 17 00:00:00 2001 From: taizan-hokuto <55448286+taizan-hokuto@users.noreply.github.com> Date: Sun, 6 Sep 2020 18:53:35 +0900 Subject: [PATCH 1/2] Fix callback handling --- pytchat/cli/__init__.py | 2 -- pytchat/processors/html_archiver.py | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pytchat/cli/__init__.py b/pytchat/cli/__init__.py index 211da9f..c11d1b5 100644 --- a/pytchat/cli/__init__.py +++ b/pytchat/cli/__init__.py @@ -88,8 +88,6 @@ def main(): except InvalidVideoIdException: print("Invalid Video ID or URL:", video_id) - except TypeError as e: - print(e.with_traceback()) except NoContents as e: print(e) except FileNotFoundError: diff --git a/pytchat/processors/html_archiver.py b/pytchat/processors/html_archiver.py index 3a1b913..39cff09 100644 --- a/pytchat/processors/html_archiver.py +++ b/pytchat/processors/html_archiver.py @@ -43,7 +43,7 @@ class HTMLArchiver(ChatProcessor): ''' HTMLArchiver saves chat data as HTML table format. ''' - def __init__(self, save_path, callback): + def __init__(self, save_path, callback=None): super().__init__() self.save_path = self._checkpath(save_path) self.processor = DefaultProcessor() @@ -93,7 +93,8 @@ class HTMLArchiver(ChatProcessor): c.author.channelId) ) ) - self.callback(None, 1) + if self.callback: + self.callback(None, 1) def _parse_html_line(self, raw_line): return ''.join(('', From 3aa413d59ee9a6df572ab995865209b1ec3737b8 Mon Sep 17 00:00:00 2001 From: taizan-hokuto <55448286+taizan-hokuto@users.noreply.github.com> Date: Sun, 6 Sep 2020 18:54:10 +0900 Subject: [PATCH 2/2] Increment version --- pytchat/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytchat/__init__.py b/pytchat/__init__.py index 38551d5..74eea41 100644 --- a/pytchat/__init__.py +++ b/pytchat/__init__.py @@ -2,7 +2,7 @@ pytchat is a lightweight python library to browse youtube livechat without Selenium or BeautifulSoup. """ __copyright__ = 'Copyright (C) 2019 taizan-hokuto' -__version__ = '0.1.8' +__version__ = '0.1.9' __license__ = 'MIT' __author__ = 'taizan-hokuto' __author_email__ = '55448286+taizan-hokuto@users.noreply.github.com'