mikf / gallery-dl

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

Question: parent>child categories for child extractor options #4621

Open dajotim937 opened 11 months ago

dajotim937 commented 11 months ago

support parent>child categories for child extractor options, for example an imgur album from a reddit thread with reddit>imgur

Can you elaborate what is this, what for and how to use this?

mikf commented 11 months ago

I assumed "for example an imgur album from a reddit thread with reddit>imgur" was a good enough example, but apparently not. Guess I should've added some actual documentation and an example to docs/gallery-dl.example.conf.

It's for specifying options for child extractors, for example when processing the link to an imgur album found in a reddit thread, to make it no longer necessary to use conditional file and directory names like here.

Instead you can now do the following and override all options and not just filename and directory.

        "imgur": {
            "#": "general imgur options",
            "filename": "{id}.{extension}"
        },
        "reddit>imgur": {
            "#": "imgur options for links found on reddit",
            "filename": "{_reddit[id]} {id}.{extension}"
        }
cheese529 commented 11 months ago

Thank you for explaining this mikf

dajotim937 commented 11 months ago

I assumed "for example an imgur album from a reddit thread with reddit>imgur" was a good enough example, but apparently not. Guess I should've added some actual documentation and an example to docs/gallery-dl.example.conf.

Yeah, I looked at docs but didn't find something about parent>child, so that's why this issue here. Mainly, I was confused with 'thread', because usually you say "child extractor" in config documentation

Okay, thank you. So follow up question. Will I be able use metadata from both extractors or only from parent one? For example, I use reddit post id AND redgifs id in filename if I download submission from reddit that contains redgifs link.

And second, how it will work with gfycat to redgif transition? Previously (before gfycat was closed and gallery had fix to redirect) I just pass down metadata and it was like reddit>gfycat>redgifs.

And thank you. This is great feature.

Hrxn commented 11 months ago

Okay, thank you. So follow up question. Will I be able use metadata from both extractors or only from parent one? For example, I use reddit post id AND redgifs id in filename if I download submission from reddit that contains redgifs link.

Yes, it's possible to use metadata from both extractors.

And second, how it will work with gfycat to redgif transition? Previously (before gfycat was closed and gallery had fix to redirect) I just pass down metadata and it was like reddit>gfycat>redgifs.

It should take the settings from RedGIFs, but have not tested this myself.

rEnr3n commented 11 months ago

How do I use reddit>imgur through the -o switch? I used it in the config file and it worked. But I have a configuration I don't want to put in my config file.

-o extractor.reddit>imgur.directory= didn't work.

dajotim937 commented 11 months ago

-o extractor.reddit>imgur.directory= didn't work.

Can't you just use -o directory=?

mikf commented 11 months ago

-o extractor.reddit>imgur.directory= didn't work.

The > needs to be escaped or your shell will interpret it as stdout redirect.

dajotim937 commented 11 months ago

And, I guess, this and this are related to new feature. You haven't changed anything in this area, have you?

mikf commented 11 months ago

No, I haven't and it will have to wait till v2.0. The current code base doesn't really allow for certain changes without having to basically rewrite (and potentially break) everything.

dajotim937 commented 11 months ago

Okay, just asking.