Nandaka / PixivUtil2

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

[feature request?] Fanbox post directory #1163

Open Yurihellsin opened 2 years ago

Yurihellsin commented 2 years ago

HI I've tried everything but can't find a way for it to download each Fanbox post in it's own directory could this be added or am I missing something?

Prerequisites

Description

[Description of the bug or feature]

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Log file: [Attach the pixivutil.log file in the application folder, recommended to delete the old file, reproduce the issue, and upload the newly generated file here]

Versions

You can get this information from executing PixivUtil2.py --help. Latest version available in https://github.com/Nandaka/PixivUtil2/releases

biggestsonicfan commented 2 years ago

It's in the README in the [FANBOX] section...

filenameFormatFanboxContent

Similar to filename format, but for files inside FANBOX posts.

filenameFormatFanboxCover

Similar to filename format, but for FANBOX post cover images

filenameFormatFanboxInfo

Similar to filename format, but for info dumps.

For example you could have this in your config.ini:

[FANBOX]
filenameFormatFanboxCover = fanbox/%member_id%/%urlFilename% - %title%
filenameFormatFanboxContent = fanbox/%member_id%/%urlFilename% - %title%
filenameFormatFanboxInfo = fanbox/%member_id%/%urlFilename% - %title%

So if you wanted each post in it's own directory you could do this: filenameFormatFanboxContent = %member_id%/%image_id%/%urlFilename% - %title%

Yurihellsin commented 2 years ago

I have my directory settings as follows

filenameformatfanboxcover = %artist% (%member_id%)/-=FANBOX=-/%urlFilename% - %title% filenameformatfanboxcontent = %artist% (%member_id%)/-=FANBOX=-/%urlFilename% - %title% filenameformatfanboxinfo = %artist% (%member_id%)/-=FANBOX=-/%urlFilename% - %title%

This does create a separate directory for fanbox but no matter what I've tried I can't get it to create sub directories for each post as like with the Manga mode.

biggestsonicfan commented 2 years ago

Oh I'm not sure you can have the = around FANBOX in the name. The INI file might be trying to interpret that. I also don't see your / files to indicate a different directory?

Yurihellsin commented 2 years ago

Oh I had the back slash instead of the forward and it was removed from the post sorry.

biggestsonicfan commented 2 years ago

Actually I'm now encountering this issue. My rootDirectory is /blah/blah/blah/pixiv/ but I can't seem to get Fanbox in a folder before /pixiv/ so it's /blah/blah/blah/pixiv/fanbox/ instead of /blah/blah/blah/fanbox/

biggestsonicfan commented 2 years ago

Admittedly, it wouldn't be too hard to add an override to Fanbox (and maybe Sketches) if the defined. If not defined, it uses the rootdir.

Yurihellsin commented 2 years ago

What I want is it to be "download directory/artists/fanbox/post"

Nandaka commented 2 years ago

try to append ..\ for relative path?

filenameFormatFanboxCover = ..\%searchTags%\%member_id% %member_token%\%R-18% %urlFilename% - %title%
filenameFormatFanboxContent = ..\%searchTags%\%member_id% %member_token%\%R-18% %urlFilename% - %title%
filenameFormatFanboxInfo =..\%searchTags%\%member_id% %member_token%\%R-18% %urlFilename% - %title%
Yurihellsin commented 2 years ago

image This is how I have it at present which means all fanbox content goes into the one directory but I'd like to have each post in it's own directory.

Nandaka commented 2 years ago

You can use %image_id%, e.g. %member_id% %member_token%\%image_id%\%R-18% %urlFilename% - %title%

Refer to https://github.com/Nandaka/PixivUtil2#filename-format-syntax