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
270 stars 40 forks source link

Program crashes when trying to create download folder with special character #62

Closed Prashanthvsdvn closed 2 years ago

Prashanthvsdvn commented 2 years ago

Describe the bug The program crashes when trying to make directory for anime names with characters that dont behave with windows file system. An example is semi colon.

To Reproduce Steps to reproduce the behavior:

  1. Run anipy-cli -d for download mode
  2. Answer 'no' for searching with Kitsu
  3. Search for anime name with semicolon
  4. Answer 'no' for another search
  5. Select the series
  6. Select the episode
  7. CRASH!!

Expected behavior The Program should start creating a folder with anime name and start downloading files

Info

WARNING: Ignoring invalid distribution -nipy-cli (c:\python310\lib\site-packages)
Name: anipy-cli
Version: 2.4.17
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:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

Additional context Traceback Logs from stderr

Traceback (most recent call last):
File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 7, in <module>
File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 8, in main
cli.main()
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 641, in main
download_cli(args.quality, args.ffmpeg, args.no_kitsu)
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 113, in download_cli
download(show_entry, ffmpeg).download()
File "C:\Python310\lib\site-packages\anipy_cli\download.py", line 41, in download
self.show_folder.mkdir(exist_ok=True)
File "C:\Python310\lib\pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\Prashanth\\.anipy-cli\\download\\Kaguya-sama wa Kokurasetai: Ultra Romantic' 

I reckon this was looking similar to #61 but its not the same.

sdaqo commented 2 years ago

I see, : is not allowed on windows, will patch this.

sdaqo commented 2 years ago

Ok, fixed in 2.4.18