mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
better support for KeyboardInterrupt exceptions
This commit is contained in:
parent
1cd25b5369
commit
5806e02f97
@ -54,5 +54,8 @@ def main():
|
|||||||
conf = parse_config_file(opts.config)
|
conf = parse_config_file(opts.config)
|
||||||
dlmgr = DownloadManager(opts, conf)
|
dlmgr = DownloadManager(opts, conf)
|
||||||
|
|
||||||
for url in opts.urls:
|
try:
|
||||||
dlmgr.add(url)
|
for url in opts.urls:
|
||||||
|
dlmgr.add(url)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("KeyboardInterrupt")
|
||||||
|
@ -75,8 +75,7 @@ class AsynchronousExtractor(Extractor):
|
|||||||
Extractor.__init__(self)
|
Extractor.__init__(self)
|
||||||
queue_size = int(config.get("general", "queue-size", fallback=5))
|
queue_size = int(config.get("general", "queue-size", fallback=5))
|
||||||
self.__queue = queue.Queue(maxsize=queue_size)
|
self.__queue = queue.Queue(maxsize=queue_size)
|
||||||
self.__thread = threading.Thread(target=self.async_items)
|
self.__thread = threading.Thread(target=self.async_items, daemon=True)
|
||||||
# self.__thread = threading.Thread(target=self.async_images, daemon=True)
|
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
get = self.__queue.get
|
get = self.__queue.get
|
||||||
|
Loading…
Reference in New Issue
Block a user