Nandaka / PixivUtil2

Download images from Pixiv and more!
http://nandaka.devnull.zone/
BSD 2-Clause "Simplified" License
2.4k stars 254 forks source link

Allow formatting of manga folder & filename #4

Closed MokoJumbie closed 12 years ago

MokoJumbie commented 12 years ago

I added a comment to your blog about this feature (http://nandaka.wordpress.com/2012/07/04/pixiv-downloader-20120704/#comment-1983)

It would be good to have some control over the folder and file names used for the manga entries. Presumably, it could use the same tags and formatting method used for file names.

Can I suggest two new tags for handling the page number part of the file name? How about:

It would also be good to be able to specify whether to use leading zeros, with the number of zeros based on the total number of images. For 100 images using %page_number% the first image would be 001. Using %page_index% the first image of 100 would be 00 and the last, 99.

Nandaka commented 12 years ago

Introduce filenameMangaFormat and added these meta format for the makeFilename. -> %urlFilename% ==> the actual filename stored in server without the file extensions. -> %page_big% ==> for manga mode, add big in the filename. -> %page_index% ==> for manga mode, add page number with 0-index. -> %page_number% ==> for manga mode, add page number with 1-index.

No leading zeroes in the page_index or page_number, windows still sort the files correctly :P

There is validation for filenameMangaFormat, if the format doesn't contains urlFilename or page_index or page_number then the format will be appended with page_index to make sure the filename is unique/correct page.

Updated in: 26924d6002eb8575f0d7fc980b75428061c6da80