Fix callback handling
This commit is contained in:
@@ -88,8 +88,6 @@ def main():
|
|||||||
|
|
||||||
except InvalidVideoIdException:
|
except InvalidVideoIdException:
|
||||||
print("Invalid Video ID or URL:", video_id)
|
print("Invalid Video ID or URL:", video_id)
|
||||||
except TypeError as e:
|
|
||||||
print(e.with_traceback())
|
|
||||||
except NoContents as e:
|
except NoContents as e:
|
||||||
print(e)
|
print(e)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class HTMLArchiver(ChatProcessor):
|
|||||||
'''
|
'''
|
||||||
HTMLArchiver saves chat data as HTML table format.
|
HTMLArchiver saves chat data as HTML table format.
|
||||||
'''
|
'''
|
||||||
def __init__(self, save_path, callback):
|
def __init__(self, save_path, callback=None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.save_path = self._checkpath(save_path)
|
self.save_path = self._checkpath(save_path)
|
||||||
self.processor = DefaultProcessor()
|
self.processor = DefaultProcessor()
|
||||||
@@ -93,7 +93,8 @@ class HTMLArchiver(ChatProcessor):
|
|||||||
c.author.channelId)
|
c.author.channelId)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.callback(None, 1)
|
if self.callback:
|
||||||
|
self.callback(None, 1)
|
||||||
|
|
||||||
def _parse_html_line(self, raw_line):
|
def _parse_html_line(self, raw_line):
|
||||||
return ''.join(('<tr>',
|
return ''.join(('<tr>',
|
||||||
|
|||||||
Reference in New Issue
Block a user