AlphaSlayer1964 / kemono-dl

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

Errno 22 #62

Closed Wolfmaster112 closed 2 years ago

Wolfmaster112 commented 2 years ago

patreon post_id: 44932567

url: https://kemono.party/patreon/user/23912698/post/44932567

cant download this one file keeping me from fully updating my local copies

full error message

DEBUG: user_id: 23912698 service: patreon post_id: 44932567 url: https://kemono.party/patreon/user/23912698/post/44932567 DEBUG: Sleeping for 0 seconds .mp3 URL: https://kemono.party/data/8e/52/8e5208518a903f1cc2f10042d05124154d9b8f463cda48094dd5245772cb88fb.mp3?f=Mommy d.mp3vers you’ve wet the bed… .mp3: Downloading [1]_Mommy_discovers_you_ve_wet_thebed Traceback (most recent call last): File "D:\kemono-dl-2021.11.03\kemono-dl.py", line 4, in main() File "D:\kemono-dl-2021.11.03\src\main.py", line 765, in main downloader(urls) File "D:\kemono-dl-2021.11.03\src\main.py", line 58, in init self.add_favorite_artists('kemono') File "D:\kemono-dl-2021.11.03\src\main.py", line 105, in add_favorite_artists self._find_posts(site,favorite['service'],favorite['id']) File "D:\kemono-dl-2021.11.03\src\main.py", line 176, in _find_posts self.download_post() File "D:\kemono-dl-2021.11.03\src\main.py", line 188, in download_post self._download_attachments() File "D:\kemono-dl-2021.11.03\src\main.py", line 324, in _download_attachments self._requests_download(file_url, file_name, file_hash) File "D:\kemono-dl-2021.11.03\src\main.py", line 562, in _requests_download with open(filename, 'ab') as f: OSError: [Errno 22] Invalid argument: "D:\kemono-dl-2021.11.03\Downloads\patreon\hypnomommy[23912698]\[20201218]_[44932567]_Patron_Only_Freebie__Mommy_Discovers_You've_Wet_the_Bed\[1]_Mommy_discovers_you_ve_wet_thebed\r.mp3"

AlphaSlayer1964 commented 2 years ago

Bruh why the fuck do they let \r a string return character be in the file name! I will fix this in the next release. For now in main.py lines 689, 690, and 697 (just to be safe) change the regex sub from this:

r'[\\/:\"*?<>|\n\t\b]'

to

r'[\\/:\"*?<>|\n\t\b\r]'