mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
10.85k stars 888 forks source link

how to put images of a set in another directory #4194

Open timeg7100 opened 1 year ago

timeg7100 commented 1 year ago

hi i want that if a download a set of images that are in one post to be in a another directory Ex: A) https://kemono.party/patreon/user/9919437/post/84384981 this post have 7 images

B) https://kemono.party/patreon/user/19113387/post/80683143 and this one have one image

and let say the directory is: /short

and i want to put (A) in a directory named (/short/long) <-----[i want this to be created if (A) was more then 1 image] and (B) in the directory (/artest)

and not just for images i want this to work for .zip and videos too

[i want to be in the config file]

can anybody help me, thx

mikf commented 1 year ago

Set a different directory format (and filename format) in your config.

The default is ["{category}", "{service}", "{user}"]. Set it to ["{category}", "{service}", "{user}", "{id} {title[:240]}"] and all files from a post will be stored in a separate directory.

timeg7100 commented 1 year ago

hi ok that is not what i meant if a post have more then 1 images then it will create a new directory for this post and if the post have 1 image then it will not create a new directory

post have n=1 images then the directory ["{category}", "{service}", "{user}"] post have n>1 images then the directory ["{category}", "{service}", "{user}", "{id} {title[:240]}"]

i hope this make it clear for you, thx

mikf commented 1 year ago
    "directory": {
        "count > 1": ["{category}", "{service}", "{user}", "{id} {title[:240]}"],
        ""         : ["{category}", "{service}", "{user}"]
    }
timeg7100 commented 1 year ago

thx this is what i was asking for :) (did not know there was a 'count ')

timeg7100 commented 1 year ago

and can i ask how to do this but for file extension (zip/rar/mp4)

thx

mikf commented 1 year ago

That's not easily doable, maybe with a classify post processor. See https://github.com/mikf/gallery-dl/issues/4146.