iiab / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
4 stars 5 forks source link

Error downloading specific Led Zeppelin video from YouTube #284

Open avni opened 2 hours ago

avni commented 2 hours ago

Describe the bug/problem

Error downloading specific video: https://www.youtube.com/watch?v=Ly6ZhQVnVow. 2 different errors on 2 different IIABs.

--

To Reproduce

Steps to reproduce the behavior:

  1. Go to '/books'
  2. Click on 'Download to IIAB'
  3. Scroll down to 'Go to Tasks page'
  4. See error

Logfile

Environment (please complete the following information):

deldesir commented 2 hours ago

Both IIABs have outdated yt-dlp:

Please update your IIABs with sudo iiab-update -f

The issue is however reproducible ~but it is not related to IIAB Calibre-Web~. image

[Testing directly with yt-dlp...]

deldesir commented 2 hours ago

image

Not a missing format issue. The error traceback is:

[2024-11-16 20:35:09,491] ERROR {cps.editbooks:326} cannot access local variable 'book_path' where it is not associated with a value
Traceback (most recent call last):
  File "/usr/local/calibre-web-py3/cps/editbooks.py", line 323, in meta
    resp = move_mediafile(requested_file, current_user_name, shelf_id, media_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/calibre-web-py3/cps/editbooks.py", line 313, in move_mediafile
    new_book_path = os.path.join(config.config_calibre_dir, book_path)
                                                            ^^^^^^^^^
UnboundLocalError: cannot access local variable 'book_path' where it is not associated with a value
deldesir commented 2 hours ago

This issue is related to https://github.com/iiab/calibre-web/issues/203.

deldesir commented 1 hour ago

The problem arises because when IIAB Calibre-Web is looking for the video ID, it assumes it is inside square brackets ([...]) in the filename. What happened for this specific video, the filename has two sets of square brackets. This is fixed in #285 which ensures video IDs are not always in the first set of square brackets if there are two or more of them, but in the last.