AlphaSlayer1964 / kemono-dl

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

Output Template bug #71

Closed ytoaa closed 2 years ago

ytoaa commented 2 years ago

sudo python3 /home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/kemono-dl.py --cookies "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/cookie.txt" --output "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/IMAGE/ETC/kemono/{service}/{username}[{user_id}]/[{published}] [{id}]/[{index}]{name}.{ext}" --from-file "/home/naworldw/exthdd/alink/me/TEMPDOWNLOAD/PROGRAM/PYTHON/kemono2/users.txt" --skip-filetypes "rar,zip,clip" When you run the command, the file is created strangely. The {service}/{username}[{user_id}]/[{published}] [{id}]/[{index}]{name}.{ext} folders are created as they are.

For example, it is created as follows. \home\naworldw\exthdd\alink\me\TEMPDOWNLOAD\IMAGE\ETC\kemono{service}{username}[{user_id}][{published}] [{id}][{index}]{name}.{ext}\patreon

AlphaSlayer1964 commented 2 years ago

Could you post the log file with --verbose ? I have not tested using linux but the output template just uses python formatting to replace the {type} with the correct string so I don't get why it removes the / and why it doesn't do the string formatting.

ytoaa commented 2 years ago

Running the same file in Windows causes the same bug. 2022-04-04 15:24:43,782:DEBUG: Given command: python kemono-dl.py --cookies cookie.txt --output /{service}/{username}[{user_id}]/[{published}] [{id}]/[{index}]{name}.{ext} --links https://kemono.party/fanbox/user/3316400/post/3520697 --skip-filetypes rar,zip,clip --verbose 2022-04-04 15:24:45,671:DEBUG: Post API URL: https://kemono.party/api/fanbox/user/3316400/post/3520697 2022-04-04 15:24:45,970:INFO: Downloading Post: 過去絵‐元修正版その2 2022-04-04 15:24:45,998:DEBUG: user_id: 3316400 service: fanbox post_id: 3520697 url: https://kemono.party/fanbox/user/3316400/post/3520697 2022-04-04 15:24:46,003:DEBUG: Sleeping for 0 seconds 2022-04-04 15:24:46,269:DEBUG: Preparing download: File Name: [1]_c948ef22-1687-4483-8145-ebca6c3413f7.jpg URL: https://kemono.party/data/76/05/76051a637986870c2c767e24d0472b8dd76eb4752acddc9b7b252a0dd70df1d6.jpg?f=c948ef22-1687-4483-8145-ebca6c3413f7.jpg 2022-04-04 15:24:46,269:INFO: Downloading [1]_c948ef22-1687-4483-8145-ebca6c3413f7.jpg 2022-04-04 15:24:47,715:DEBUG: Download completed successfully 2022-04-04 15:24:47,715:DEBUG: Preparing download: File Name: [2]_過去絵‐元修正版その2.zip URL: https://kemono.party/data/81/16/811606c70f8debee96dcfc56881edd4e2868e618e342ded67b5c92d6fdd53893.zip?f=過去絵‐元修正版その2.zip 2022-04-04 15:24:47,715:INFO: Skipping download: File extention excluded: zip 2022-04-04 15:24:48,061:DEBUG: Completed in 00:00:03 2022-04-04 15:24:48,061:INFO: Completed

ytoaa commented 2 years ago

Is there a problem with the setting?

AlphaSlayer1964 commented 2 years ago

Can you try this output template

--output "/TEST/{service}/{username}[{user_id}]/[{published}] [{id}]/[{index}]{name}.{ext}"

I can confirm this works and your command seems correct so I'm not exactly sure the problem. What version of python are you using?

ytoaa commented 2 years ago

image

As a result of trying it again with this command, the result was the same as the picture. And in a Windows environment, Python version is 3.10.2 and Raspbian (linux) version 3.9.2. But they both have the same results.

2022-04-06 04:59:35,835:DEBUG: Given command: python kemono-dl.py --cookies cookie.txt --output /TEST/{service}/{username}[{user_id}]/[{published}] [{id}]/[{index}]{name}.{ext} --links https://kemono.party/fanbox/user/3316400/post/3520697 --skip-filetypes rar,zip,clip --verbose 2022-04-06 04:59:37,873:DEBUG: Post API URL: https://kemono.party/api/fanbox/user/3316400/post/3520697 2022-04-06 04:59:38,162:INFO: Downloading Post: 過去絵‐元修正版その2 2022-04-06 04:59:38,172:DEBUG: user_id: 3316400 service: fanbox post_id: 3520697 url: https://kemono.party/fanbox/user/3316400/post/3520697 2022-04-06 04:59:38,176:DEBUG: Sleeping for 0 seconds 2022-04-06 04:59:38,189:DEBUG: Preparing download: File Name: [1]_c948ef22-1687-4483-8145-ebca6c3413f7.jpg URL: https://kemono.party/data/76/05/76051a637986870c2c767e24d0472b8dd76eb4752acddc9b7b252a0dd70df1d6.jpg?f=c948ef22-1687-4483-8145-ebca6c3413f7.jpg 2022-04-06 04:59:38,189:INFO: Downloading [1]_c948ef22-1687-4483-8145-ebca6c3413f7.jpg 2022-04-06 04:59:39,625:DEBUG: Download completed successfully 2022-04-06 04:59:39,625:DEBUG: Preparing download: File Name: [2]_過去絵‐元修正版その2.zip URL: https://kemono.party/data/81/16/811606c70f8debee96dcfc56881edd4e2868e618e342ded67b5c92d6fdd53893.zip?f=過去絵‐元修正版その2.zip 2022-04-06 04:59:39,625:INFO: Skipping download: File extention excluded: zip 2022-04-06 04:59:39,937:DEBUG: Completed in 00:00:03 2022-04-06 04:59:39,937:INFO: Completed

AlphaSlayer1964 commented 2 years ago

What doesn't make sense is that after it makes the folders with the {variables} it then does part of the default format. When you pass --output the default is overwritten. Just for sanity check can you paste the exact command you are using in a code block form me.

ytoaa commented 2 years ago

Is it impossible to solve in the current version?

AlphaSlayer1964 commented 2 years ago

Is it impossible to solve in the current version?

The problem is I'm not sure what the problem is. I am unable to reproduce the broken folder structure even using your output template.

ytoaa commented 2 years ago

Does the output template work normally in your environment?

AlphaSlayer1964 commented 2 years ago

You are not using the pre release that is the problem.