AlphaSlayer1964 / kemono-dl

A simple kemono.party downloader using python.
509 stars 82 forks source link

Getting WinError when trying to create directory for certain post.py #54

Closed itsaferbie closed 2 years ago

itsaferbie commented 2 years ago

Version

Version: 2022.02.08

Your Command


python kemono-dl.py --cookies "kemono.party_cookies.txt" -o "X:\smol\Kemono" --links https://kemono.party/fanbox/user/8814278

Description of bug

Only occurs when it reaches a post from this user.

How To Reproduce

Run command that I posted and it will error out once it reaches the post in the error field.

Error messages and tracebacks


Traceback (most recent call last):
  File "X:\smol\kemono-dl\kemono-dl.py", line 4, in <module>
    main()
  File "X:\smol\kemono-dl\src\main.py", line 748, in main
    downloader(urls)
  File "X:\smol\kemono-dl\src\main.py", line 68, in __init__
    self.add_links()
  File "X:\smol\kemono-dl\src\main.py", line 120, in add_links
    self._parse_links(url)
  File "X:\smol\kemono-dl\src\main.py", line 128, in _parse_links
    self._find_posts(user.group(1),user.group(2),user.group(3))
  File "X:\smol\kemono-dl\src\main.py", line 176, in _find_posts
    self.download_post()
  File "X:\smol\kemono-dl\src\main.py", line 187, in download_post
    self._download_content()
  File "X:\smol\kemono-dl\src\main.py", line 330, in _download_content
    os.makedirs(self.current_post_path)
  File "C:\Users\Don\AppData\Local\Programs\Python\Python39\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'X:\\smol\\Kemono\\fanbox\\camonome [8814278]\\[20210823] [2645261] 暑さを理由に休憩したがるヤンキー女子\x08'

Additional comments

Link to Artist

Post that causes error

AlphaSlayer1964 commented 2 years ago

I see the problem. The hex value \x08 represents a backspace character like how \n is newline character. Why a backspace character is allowed in a title name is beyond me. I'll add it to the excluded file name characters and push an update.