This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
[FEATURE] Cleanly handle when JDownloader not available #767
Labels
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
Sort of... I didn't have JDownloader running (different device), and CD got stuck in a loop (I think) trying to connect to it.
Describe the solution you'd like
Would be nice to have an option in config to set timeout and how to handle when CD can't connect to JD. It could have "Quit without Scraping" or "Wait for JDownloader" or "Scrape without JDownloader" as options to pick from.
Additional context
Traceback is below for failing to connect to JD:
Starting Download...
Exception Group Traceback (most recent call last):
| File "/root/.local/bin/cyberdrop-dl", line 8, in
| sys.exit(main())
| ^^^^^^
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/cyberdrop_dl/main.py", line 129, in main
| asyncio.run(director(manager))
| File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
| return runner.run(main)
| ^^^^^^^^^^^^^^^^
| File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
| return self._loop.run_until_complete(task)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
| return future.result()
| ^^^^^^^^^^^^^^^
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/cyberdrop_dl/main.py", line 87, in director
| await runtime(manager)
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/cyberdrop_dl/main.py", line 43, in runtime | async with asyncio.TaskGroup() as task_group:
| File "/usr/lib/python3.11/asyncio/taskgroups.py", line 133, in aexit
| raise me from None
| BaseExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/cyberdrop_dl/main.py", line 45, in runtime
| await scrape_mapper.start()
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/cyberdrop_dl/scraper/scraper.py", line 261, in start
| await self.start_jdownloader()
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/cyberdrop_dl/scraper/scraper.py", line 254, in start_jdownloader
| await self.jdownloader.jdownloader_setup()
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/cyberdrop_dl/scraper/jdownloader.py", line 35, in jdownloader_setup
| self.jdownloader_agent = jd.get_device(self.jdownloader_device)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/root/.local/pipx/venvs/cyberdrop-dl/lib/python3.11/site-packages/myjdapi/myjdapi.py", line 1304, in get_device
| raise (MYJDDeviceNotFoundException("Device not found\n"))
| myjdapi.exception.MYJDDeviceNotFoundException: Device not found
+------------------------------------
^CException ignored in: <module 'threading' from '/usr/lib/python3.11/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1583, in _shutdown
lock.acquire()
KeyboardInterrupt:
The text was updated successfully, but these errors were encountered: