From 5f53fd24dd213d7a0a3602235991d7b1c2bbb7b1 Mon Sep 17 00:00:00 2001 From: taizan-hokuto <55448286+taizan-hokuto@users.noreply.github.com> Date: Sat, 12 Sep 2020 00:48:40 +0900 Subject: [PATCH] Format --- pytchat/cli/__init__.py | 6 +++--- pytchat/exceptions.py | 1 - pytchat/tool/extract/worker.py | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pytchat/cli/__init__.py b/pytchat/cli/__init__.py index 213f8e7..3dd4bc7 100644 --- a/pytchat/cli/__init__.py +++ b/pytchat/cli/__init__.py @@ -57,8 +57,8 @@ def main(): else: raise FileNotFoundError err = None - for _ in range(3): # retry 3 times - try: + for _ in range(3): # retry 3 times + try: info = VideoInfo(video_id) break except (PatternUnmatchError, JSONDecodeError, InvalidVideoIdException) as e: @@ -81,7 +81,7 @@ def main(): print(f" output path: {path.resolve()}") duration = info.get_duration() pbar = ProgressBar(total=(duration * 1000), status="Extracting") - ex = Extractor(video_id, + ex = Extractor(video_id, callback=pbar._disp, div=10) signal.signal(signal.SIGINT, (lambda a, b: cancel(ex, pbar))) diff --git a/pytchat/exceptions.py b/pytchat/exceptions.py index 9e498d1..1bd918c 100644 --- a/pytchat/exceptions.py +++ b/pytchat/exceptions.py @@ -43,7 +43,6 @@ class InvalidVideoIdException(Exception): self.doc = doc - class UnknownConnectionError(Exception): pass diff --git a/pytchat/tool/extract/worker.py b/pytchat/tool/extract/worker.py index f48fc03..261de10 100644 --- a/pytchat/tool/extract/worker.py +++ b/pytchat/tool/extract/worker.py @@ -7,7 +7,6 @@ from typing import Tuple class ExtractWorker: """ ExtractWorker associates a download session with a block. - When the worker finishes fetching, the block being fetched is splitted and assigned the free worker.