sdaqo / anipy-cli

Little tool in python to watch and download anime from the terminal (the better way to watch anime). Also applicable as an API
https://sdaqo.github.io/anipy-cli
GNU General Public License v3.0
231 stars 37 forks source link

Downloading anime bug (Some Anime have a whitespace at the end of the name) #85

Closed hakushiii closed 1 year ago

hakushiii commented 1 year ago

Describe the bug Bug where the download path is not found because of the whitespace after the folder name (seen with "Neon Genesis Evangelion ")

To Reproduce (dl) PS C:\Users\jerom> anipy-cli -d Download Mode Downloads are stored in: E:\ANIME Search Kitsu for anime in Season? (y|n): n Search: neon genesis eva Add another search: (y|n) n

Current: neon genesis eva [1] Neon Genesis Evangelion [2] Neon Genesis Evangelion (Dub) [3] Neon Genesis Evangelion: Death & Rebirth [4] Neon Genesis Evangelion: Death & Rebirth (Dub) [5] Neon Genesis Evangelion: The End of Evangelion (Dub) Enter Number: 1 Episode (Range with '-') [1-26] 1 anipy-cli: error: quality not avalible, using default Neon Genesis Evangelion _1.mp4 E:\ANIME\Neon Genesis Evangelion \Neon Genesis Evangelion _1.mp4

Downloading: Neon Genesis Evangelion EP: 1 - hls Type: m3u8 Downloader: internal Traceback (most recent call last): File "C:\Users\jerom\miniconda3\envs\dl\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\jerom\miniconda3\envs\dl\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\jerom\miniconda3\envs\dl\Scripts\anipy-cli.exe__main__.py", line 7, in File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\run_anipy_cli.py", line 8, in main cli.main() File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\cli.py", line 670, in main download_cli(args. quality, args.ffmpeg, args.no_kitsu) File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\cli.py", line 133, in download_cli download(show_entry, ffmpeg).download() File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\download.py", line 85, in download self.multithread_m3u8_dl() File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\download.py", line 265, in multithread_m3u8_dl self.temp_folder.mkdir(exist_ok=True) File "C:\Users\jerom\miniconda3\envs\dl\lib\pathlib.py", line 1313, in mkdir self._accessor.mkdir(self, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'E:\ANIME\Neon Genesis Evangelion \1_temp'

Expected behavior Download the Episode

Info Name: anipy-cli Version: 2.5.3 Summary: Little tool in python to watch anime from the terminal (the better way to watch anime) Home-page: https://github.com/sdaqo/anipy-cli Author: sdaqo Author-email: sdaqo.dev@protonmail.com License: GPL-3.0 Location: c:\users\jerom\miniconda3\envs\dl\lib\site-packages Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm Required-by:

Platform

Additional context I made a temporary fix on my end at download.py where the show_name checks if the anime name has the character " " at the end and remove it if it exists. temp_flix

VoidAny commented 1 year ago

Thanks for finding out why the bug happened. I'll make a pull request to fix this. The better solution would be to just use the .strip() string method to get rid of the white space, instead of manually looking for it.

hakushiii commented 1 year ago

Thank you! ^^