AlphaSlayer1964 / kemono-dl

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

There was a "No such file or directory" issue. #76

Closed ytoaa closed 2 years ago

ytoaa commented 2 years ago

Version

Version: 2022.02.26.

Your Command

python kemono-dl.py --cookies cookie.txt --link https://kemono.party/patreon/user/16112298/post/42779774 --verbose

Description of bug

An error appears when trying to download the link. This will be downloaded normally in the 2022-02.21 and 2022-02.10 versions, but will not work with the following error in the latest release, 2022.02.26. Running environment is Windows 10 64bit and Python version is 3.10.2

Error messages and tracebacks


2022-04-08 02:49:22,632:DEBUG: Given command: python kemono-dl.py --cookies cookie.txt --link https://kemono.party/patreon/user/16112298/post/42779774 --verbose
2022-04-08 02:49:26,051:DEBUG: Post API URL: https://kemono.party/api/patreon/user/16112298/post/42779774
2022-04-08 02:49:26,363:INFO: Downloading Post: 움짤투표(GIF Voting)
2022-04-08 02:49:26,364:DEBUG: user_id: 16112298 service: patreon post_id: 42779774 url: https://kemono.party/patreon/user/16112298/post/42779774
2022-04-08 02:49:26,365:DEBUG: Sleeping for 0 seconds
2022-04-08 02:49:26,365:DEBUG: Downlaoding attachments
Traceback (most recent call last):
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\kemono-dl.py", line 4, in
main()
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\src\main.py", line 807, in main
downloader(urls)
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\src\main.py", line 68, in init
self.add_links()
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\src\main.py", line 109, in add_links
self.parse_links(url)
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\src\main.py", line 119, in parse_links
self.get_posts(site=post.group(1),service=post.group(2),user_id=post.group(3),post_id=post.group(4))
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\src\main.py", line 162, in get_posts
self.download_post()
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\src\main.py", line 238, in download_post
self.download_content()
File "E:\Down\kemono-dl-2022.02.26\kemono-dl-2022.02.26\src\main.py", line 347, in download_content
with open(os.path.join(self.current_post['path'], self.set_file_name('content','html')),'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'Downloads\patreon\gweda [16112298]\[20201015] [42779774] 움 짤투표(GIF Voting)\[0] content.html'

Error messages and tracebacks



DEBUG: Given command: python /home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/kemono-dl.py --cookies /home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/cookie.txt -o /home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/IMAGE/ETC/kemono/{service}/{username} [{user_id}]/[{published}] [{id}]/[{index}]_{name}.{ext} --skip-filetypes rar,zip,clip --links https://kemono.party/fanbox/user/871625/post/3643673 --verbose
DEBUG: Post API URL: https://kemono.party/api/fanbox/user/871625/post/3643673
INFO: Downloading Post: プリコネようじょ PSD
DEBUG: user_id: 871625 service: fanbox post_id: 3643673 url: https://kemono.party/fanbox/user/871625/post/3643673
DEBUG: Sleeping for 0 seconds
DEBUG: Downlaoding attachments
INFO: Downloading: [1]_PSD.zip
DEBUG: Download path: home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/IMAGE/ETC/kemono/fanbox/lambda [871625]/[20220405] [3643673]
DEBUG: Download url: https://kemono.party/data/3a/2b/3a2b27d99bc3b813b813f4ac25ec14c4bb4117a3d1dd44cb05f4cce466a45826.zip?f=PSD.zip
INFO: Skipping download because of file extention: zip
Traceback (most recent call last):
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/kemono-dl.py", line 4, in <module>
    main()
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/src/main.py", line 807, in main
    downloader(urls)
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/src/main.py", line 68, in __init__
    self.add_links()
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/src/main.py", line 109, in add_links
    self.parse_links(url)
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/src/main.py", line 119, in parse_links
    self.get_posts(site=post.group(1),service=post.group(2),user_id=post.group(3),post_id=post.group(4))
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/src/main.py", line 162, in get_posts
    self.download_post()
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/src/main.py", line 238, in download_post
    self.download_content()
  File "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/src/main.py", line 347, in download_content
    with open(os.path.join(self.current_post['path'], self.set_file_name('content','html')),'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/IMAGE/ETC/kemono/fanbox/lambda [871625]/[20220405] [3643673]/[0]_content.html'

### Additional comments
<!-- Anything else you think might help. -->
AlphaSlayer1964 commented 2 years ago

After you run the script are these folders not created? Downloads\patreon\gweda [16112298]\[20201015] [42779774] 움 짤투표(GIF Voting) home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/IMAGE/ETC/kemono/fanbox/lambda [871625]/[20220405] [3643673] I finally have some free time so I will be working on all the folder and file naming errors this weekend.

ytoaa commented 2 years ago

Yes, the folder will not be created. The download proceeds normally only when you add the --skip-comments option. I think there is a problem in downloading the html file.

AlphaSlayer1964 commented 2 years ago

Weird because I'm using open('content.html','wb') so python should create the file. It seems to be searching for it to open though. I should have a better release by the end of the weekend. Hopefully it should fix these issues.

AlphaSlayer1964 commented 2 years ago

Hmmm even more strange I looked at the posts that got the error. and neither of them even have post content. There is a check to see if the content is empty but even still it should just create an empty file.

ytoaa commented 2 years ago

It's interesting that this issue only occurs in the 2022.02.26 version.

crimzind commented 2 months ago

Don't suppose there was ever any resolution to this? For me, it's making folders, but not downloading content, and still giving the [Errno 2]. :(