AlphaSlayer1964 / kemono-dl

A simple kemono.party downloader using python.
504 stars 81 forks source link

Getting WinError when trying to create directory for certain post #69

Closed uhue closed 2 years ago

uhue commented 2 years ago

Version

Version: 2022.02.10

Your Command

python kemono-dl.py --cookies kemono.party_cookies.txt --extract-links --skip-comments --verbose -o D:\kemono.party -l "https://kemono.party/patreon/user/556390"

Description of bug

WinError 123 when it reaches a certain post of the user.

How To Reproduce

Run command that is posted.

Error messages and tracebacks


Traceback (most recent call last):
  File "C:\Users\Areen Amjad\Documents\kemono-dl\kemono-dl.py", line 4, in <module>
    main()
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 765, in main
    downloader(urls)
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 68, in __init__
    self.add_links()
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 120, in add_links
    self._parse_links(url)
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 128, in _parse_links
    self._find_posts(user.group(1),user.group(2),user.group(3))
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 176, in _find_posts
    self.download_post()
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 187, in download_post
    self._download_content()
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 333, in _download_content
    os.makedirs(self.current_post_path)
  File "C:\Users\Areen Amjad\AppData\Local\Programs\Python\Python310\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\kemono.party\\patreon\\toneeartwork [556390]\\[20210214] [47538372] \x1dJanuary 2021 rewards preview'

Additional comments

link to user link to post that errors

AlphaSlayer1964 commented 2 years ago

I don't get why they allow weird unicode character is these titles. For now I would use --restrict-names that should remove that unicode character causing the issue.

uhue commented 2 years ago

seems that using --restrict-names does not to fix it. I am still getting the same error.

Below is the command I am using. python "C:\Users\Areen Amjad\Documents\kemono-dl\kemono-dl.py" --cookies "C:\Users\Areen Amjad\Documents\kemono-dl\kemono.party_cookies.txt" --kemono-favorite-users --skip-comments --restrict-names --extract-links -o E:\kemono.party

Below is the error I am receiving.


Traceback (most recent call last):
  File "C:\Users\Areen Amjad\Documents\kemono-dl\kemono-dl.py", line 4, in <module>
    main()
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 765, in main
    downloader(urls)
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 58, in __init__
    self.add_favorite_artists('kemono')
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 105, in add_favorite_artists
    self._find_posts(site,favorite['service'],favorite['id'])
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 176, in _find_posts
    self.download_post()
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 187, in download_post
    self._download_content()
  File "C:\Users\Areen Amjad\Documents\kemono-dl\src\main.py", line 333, in _download_content
    os.makedirs(self.current_post_path)
  File "C:\Users\Areen Amjad\AppData\Local\Programs\Python\Python310\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'E:\\kemono.party\\patreon\\toneeartwork_[556390]\\[20210214]_[47538372]_\x1dJanuary_2021_rewards_preview'```
AlphaSlayer1964 commented 2 years ago

For right now I would recommend using the --archive option and manually adding that post to it so it is skipped. even without `--restrict-names slashes should always remove from the file name. Will have to look into it more.

AlphaSlayer1964 commented 2 years ago

I finally figured out the issue of the stupid Unicode character. I will have a new release this weekend that fixes it.