Script to convert only webp to jpg and rename #4899
Nephiro
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
For those who don't like having wrong extensions but doesn't want to convert files I found another solution: #4791 (comment) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since I don't like the webp format I created a script to convert the images from webp to jpg. It also has a renaming function.
I know that there is the setting in the downloader to convert the images at the end, but I want to convert only webp, that option convert all the images, even png (or jpg in case you select png) that I'm ok with it
Works like this:
With the variable "SITES_LIST" you activate the rename function (if you don't want it then write "SITES_LIST = []"), if you wanna add a site you need to check the name of the downloader you are using, for example downloading from exHentai the downloader name to add is "ehen".
If you want the rename function it will rename the files at the end of the process with this format. If the total pages to download are below 100 then it will have 2 digits (ex: 01.jpg, 02.jpg, etc). if between 100 and 999 will have 3 digits (ex: 001.jpg, 002.jpg, etc), etc.
The rename function has another feature. Some posts in site like exHentai have the author already in the title (but not all), so this script will search if the artist is already in the name and will fix it, even the folder name. If instead the author is missing, it will remove the [N\A] from the folder name.
I think I already covered most of the sites with this problem, but if you wanna add or remove you can do it easily like I said before.
Also there is the SPECIAL_AUTHORS_LIST variable, where you can fix some author name. Mostly because the ones already wrote in the title are not correct (like wrong lower characters, etc), if you notice problems with the post you are downloading, just add the "fixed" author name in the list and you are done. Beware that if the author name has different space characters, like for example "Arisayoshi" and "Arisa Yoshi", then it will not work and you have to fix it manually
Here the script:
Beta Was this translation helpful? Give feedback.
All reactions