AlphaSlayer1964 / kemono-dl

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

Modifying file output structure + small QOL #30

Closed sybarix closed 2 years ago

sybarix commented 2 years ago

It would be good if it were possible to modify the output structure (at the bottom of this post).

Also, the readme usage instructions stated that "5. Run python kemono-dl.py --cookies "cookie.txt" --links https://kemono.party/SERVICE/user/USERID", but I could only get it to work by substituting "python" with "py". Adding a line to clarify that might help 100% beginners like myself.

Thanks for this program.

CWD ├── kemono-dl.py └── Downloads └── {service} └── {username} [{user_id}] ├── {username} [{user_id}] icon.ext ├── {username} [{user_id}] banner.ext └── [{date}] [{post_id}] {post_title} ├── external files │ └── video.mp4 ├── attachments │ └── attachment.ext ├── inline │ └── image.ext ├── content.html ├── comments.html ├── embeds.txt ├── external_links.txt ├── file.ext └── {post_id}.json

AlphaSlayer1964 commented 2 years ago

When running for some reason it has to be run differently based on how it was setup or something like that. I know python3 is also a valid launch command. If you go into the api.py file you can change things manually. Do you have any suggestions for what you want for alternate folder names?

sybarix commented 2 years ago

I was hoping to set it up as follows:

output directory > folder named as "Username (user ID)" > file named as "[Post number] Post name - Original file name" or output directory > folder named as "Username (user ID)" > file named as "[Post number] Post name - Number counting from 1"

This is because certain elements such as {service} are not relevant to me, and some artists make many separate posts containing a single file which can make individual post folders messy at times. I will try to take a look at the api and see if I can figure it out, many thanks.

AlphaSlayer1964 commented 2 years ago

So I use the service folder because there are different services. If you don't want that folder in the api.py you can change line 296

# Change this:
info['path'] = os.path.join(args['output'], info['service'], win_folder_name('{username} [{id}]'.format(**info)))
# To this:
info['path'] = os.path.join(args['output'], win_folder_name('{username} [{id}]'.format(**info)))

So a reason I'm not using post numbers for the post folder is because some services have tiers so order would be off if higher tier posts were added later. Also kemono doesn't index the posts with a post number but they order them with creation date. If you have any other questions about changing the folder path names let me know and I'll try to help.

sybarix commented 2 years ago

Thanks a lot!

AlphaSlayer1964 commented 2 years ago

Fell free to make a fork of my project so you can edit it and it would make it easier if you wanted me to take a look at something.