gallery-dl icon indicating copy to clipboard operation
gallery-dl copied to clipboard

More settings for saving files.

Open Oleksandrigo opened this issue 1 year ago • 5 comments

I would like for example the ability to save tags of artists or copyright, in particular this applies to booru sites (+sankaku). Such a thing is implemented in the Grabber, but it does not like sankaku =(

Oleksandrigo avatar Jul 31 '22 11:07 Oleksandrigo

You can use a metadata post processor to write all metadata associated with a file, including tags, to a separate file. The easiest way of accomplishing that is simply using --write-metadata.

For booru sites and sankaku, you can also enable the tags option to have them categorized by artist, copyright, etc. (-o tags=true)

mikf avatar Jul 31 '22 19:07 mikf

You can use a metadata post processor to write all metadata associated with a file, including tags, to a separate file. The easiest way of accomplishing that is simply using --write-metadata.

For booru sites and sankaku, you can also enable the tags option to have them categorized by artist, copyright, etc. (-o tags=true)

Thanks? It's works! =)

Oleksandrigo avatar Aug 01 '22 05:08 Oleksandrigo

In order not to multiply the topics, I would like to ask. How can I make tag_character empty select another name, for example misc. I tried to do it with alternative "|", but faced with a problem that the square brackets are reserved as indexing or slices, but to make a list of them can not (to substitute for :J=/) and eventually gives an error.

Maybe I'm not thinking correctly, but I just want to if there are tags, then substituted them in a certain folder, and if not - in the general folder misc.

My config.

"tags": true,
"filename": "{tags_character|['misc']:J+/}_{md5}.{extension}", 

Oleksandrigo avatar Aug 01 '22 06:08 Oleksandrigo

You can use a metadata post processor to write all metadata associated with a file, including tags, to a separate file. The easiest way of accomplishing that is simply using --write-metadata. For booru sites and sankaku, you can also enable the tags option to have them categorized by artist, copyright, etc. (-o tags=true)

Thanks? It's works! =)

Although you removed the command from that post, I need to mention regardless: you must quote the param[eter]s (specifically the ones with wave brackets, but all the better if everything else too) to avoid the command shell mangling them (and ensure Python and gdl receives them), with either single quotes (Linux and the like, and PowerShell) or double quotes (everything, especially Command Prompt on Window$).

rautamiekka avatar Aug 01 '22 15:08 rautamiekka

I just want to if there are tags, then substituted them in a certain folder, and if not - in the general folder misc.

You should use conditional format strings for that. Literals (['misc']) only allow for strings, and those interact in a rather counterintuitive way with J

    "filename": {
        "locals().get('tags_character')": "{tags_character:J+/}_{md5}.{extension}",
        ""                              : "misc_{md5}.{extension}"
    },

(the same is also possible for directory settings)

mikf avatar Aug 03 '22 12:08 mikf