jo1gi / audiobook-dl

Audiobook CLI downloader
GNU General Public License v3.0
248 stars 43 forks source link

Bug File name too long #109

Closed bonzoskill closed 4 months ago

bonzoskill commented 5 months ago

Installation method: pipx (arch)

Version: Python 3.12 and audiobook-dl 0.7.3

Describe the bug OSError: [Errno 36] File name too long: After trying to download a podcast with a long name

Command output audiobook-dl --username username --password password https://www.storytel.com/it/books/i-miracoli-delle-campagne-elettorali-israele-bombarda-una-scuola-40-morti-putin-sarei-uno-scemo-ad-attaccare-la-nat-stoltenberg-e-vero-meloni-da-mentana-tra-numeri-e-mezze-verit%C3%A0-la-bce-taglia-i-tassi-ombrelloni-dove-i-pi%C3%B9-cari-8719787 --debug DEBUG audiobook-dl 0.7.3 DEBUG python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417] INFO Finding compatible source INFO Authenticating with storytel DEBUG Logging in DEBUG Downloading result of https://www.storytel.com/it/books/i-miracoli-delle-campagne-elettorali-israele-bombarda-una-scuola-40- morti-putin-sarei-uno-scemo-ad-attaccare-la-nat-stoltenberg-e-vero-meloni-da-mentana-tra-numeri-e-mezz e-verit%C3%A0-la-bce-taglia-i-tassi-ombrelloni-dove-i-pi%C3%B9-cari-8719787 INFO INFO Downloading I miracoli delle campagne elettorali. Israele bombarda una scuola, 40 morti. Putin: “Sarei uno scemo ad attaccare la Nat”, Stoltenberg: “E’ vero”. Meloni da Mentana, tra numeri e mezze verità. La Bce taglia i tassi. Ombrelloni, dove i più cari? from storytel DEBUG Starting downloading file: https://www.storytel.com/mp3streamRangeReq?startposition=0&programId=7602265&token=RJpb1MH9CBlnFzWAhwc HPB9lPEeMzNzc DEBUG expected_status_code not set by source, status-code is 200, please update the source implementation DEBUG expected_content_type not set by source, content-type is audio/mpeg, please update the source implementation Downloading I miracoli delle campagne elettorali. Israele bombarda una scuola, 40 morti. Putin: “S… … Traceback (most recent call last): File "/home/bonzo/.local/bin/audiobook-dl", line 8, in sys.exit(main()) ^^^^^^ File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/main.py", line 31, in main process_url(url, options, config) File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/main.py", line 58, in process_url process_audiobook(result, options) File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/main.py", line 163, in process_audiobook download(audiobook, options) File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/output/download.py", line 37, in download download_audiobook(audiobook, output_dir, options) File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/output/download.py", line 47, in download_audiobook filepaths = download_files_with_cli_output(audiobook, output_dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/output/download.py", line 133, in download_files_with_cli_output filepaths = download_files(audiobook, output_dir, update_progress) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/output/download.py", line 200, in download_files for filepath in pool.imap(download_file, arguments): File "/usr/lib/python3.12/multiprocessing/pool.py", line 873, in next raise value File "/usr/lib/python3.12/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, *kwds)) ^^^^^^^^^^^^^^^^^^^ File "/home/bonzo/.local/share/pipx/venvs/audiobook-dl/lib/python3.12/site-packages/audiobookdl/output/download.py", line 181, in download_file with open(filepath, "wb") as f: ^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 36] File name too long: 'I miracoli delle campagne elettorali. Israele bombarda una scuola, 40 morti. Putin: “Sarei uno scemo ad attaccare la Nat”, Stoltenberg: “E’ vero”. Meloni da Mentana, tra numeri e mezze verità. La Bce taglia i tassi. Ombrelloni, dove i più cari?.mp3'

freddy36 commented 4 months ago

This should be already fixed in https://github.com/jo1gi/audiobook-dl/commit/7567b2d33e1caac9911407e6386bae9e0ea05107

Please try the current master branch or the https://github.com/jo1gi/audiobook-dl/releases/tag/v0.7.4 pre release