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
259 stars 38 forks source link

Anime with any invalid characters in the title fails to download #66

Closed SquidDudeGB closed 2 years ago

SquidDudeGB commented 2 years ago

Describe the bug The download folder for any anime with any of these characters in the title ("\", "/", ":", "*", "?", "<", ">", "|") is not created and it fails to download

To Reproduce Steps to reproduce the behavior: (This is just the example I ran into, any anime with those characters in the title should theoretically not work either) 1) Enter "anipy-cli -d" into cmd 2) Don't search in season 3) Search "konosuba" 4) Select option 9 (Kono Subarashii Sekai ni Shukufuku wo!: Kurenai Densetsu) 5) Select episode 1 6) See error

Expected behavior Expected the folder with the name of the anime to be created and the episode to be downloaded to that folder (for the record, watching it in the cmd prompt didn't work either)

Info Name: anipy-cli Version: 2.4.19 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\my user\appdata\local\programs\python\python310\lib\site-packages Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm Required-by:

Platform

sdaqo commented 2 years ago

should work now in 2.4.20

XaaRii commented 2 years ago

I seem to have the same problem, tried downloading an anime with ":" in the name and it threw 'invalid directory name' error at me

anipy-cli: latest build (v2.4.25) OS: win10 21H2 Python 3.10.5

sys.platform -> 'win32'

not sure where the problem is... is there a simple way to force it? I'm not really keen on hacking it on every update. edit: Oh yeah sorry for posting in a closed issue, making a new one seemed like a waste..

sdaqo commented 2 years ago

Ah yes last time I only made it replace the chars in the name of the video file not for the directory. Will patch this.

SquidDudeGB commented 2 years ago

I got around the issue by forcing a folder name temporarily in downloader.py, end of line 40. I think the issue lies there, it grabs the show name and uses that too name the folder, but if the show has any banned characters in the name the folder can't be made.

sdaqo commented 2 years ago

Yeah we can extract the method used in line 397 to a new function and apply it to both the file name and the directory name

sdaqo commented 2 years ago

Fixed in v2.2.27