Format
This commit is contained in:
@@ -57,8 +57,8 @@ def main():
|
|||||||
else:
|
else:
|
||||||
raise FileNotFoundError
|
raise FileNotFoundError
|
||||||
err = None
|
err = None
|
||||||
for _ in range(3): # retry 3 times
|
for _ in range(3): # retry 3 times
|
||||||
try:
|
try:
|
||||||
info = VideoInfo(video_id)
|
info = VideoInfo(video_id)
|
||||||
break
|
break
|
||||||
except (PatternUnmatchError, JSONDecodeError, InvalidVideoIdException) as e:
|
except (PatternUnmatchError, JSONDecodeError, InvalidVideoIdException) as e:
|
||||||
@@ -81,7 +81,7 @@ def main():
|
|||||||
print(f" output path: {path.resolve()}")
|
print(f" output path: {path.resolve()}")
|
||||||
duration = info.get_duration()
|
duration = info.get_duration()
|
||||||
pbar = ProgressBar(total=(duration * 1000), status="Extracting")
|
pbar = ProgressBar(total=(duration * 1000), status="Extracting")
|
||||||
ex = Extractor(video_id,
|
ex = Extractor(video_id,
|
||||||
callback=pbar._disp,
|
callback=pbar._disp,
|
||||||
div=10)
|
div=10)
|
||||||
signal.signal(signal.SIGINT, (lambda a, b: cancel(ex, pbar)))
|
signal.signal(signal.SIGINT, (lambda a, b: cancel(ex, pbar)))
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ class InvalidVideoIdException(Exception):
|
|||||||
self.doc = doc
|
self.doc = doc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class UnknownConnectionError(Exception):
|
class UnknownConnectionError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ from typing import Tuple
|
|||||||
class ExtractWorker:
|
class ExtractWorker:
|
||||||
"""
|
"""
|
||||||
ExtractWorker associates a download session with a block.
|
ExtractWorker associates a download session with a block.
|
||||||
|
|
||||||
When the worker finishes fetching, the block
|
When the worker finishes fetching, the block
|
||||||
being fetched is splitted and assigned the free worker.
|
being fetched is splitted and assigned the free worker.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user