How to format this metadata json file with double quotes? #2871
-
I'm trying to make a custom format json with double quotes for every tag but I can't seem to find a way to format it the way I need it, I have this settings in my postprocessor as of now:
This is the result: { but I need this: { I've tried multiple ways but all of them end in the app telling me that I'm missing a delimiter or a similar error, also tried the other modes described here https://github.com/mikf/gallery-dl/blob/master/docs/configuration.rst#metadatamode but couldn't figure out how to do it. I just discovered this project a couple of days ago so I'm probably missing something but already spent a couple of hours on this so I decided to ask. Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
To use double quotes inside a double-quoted string, you have to escape the quote with a backslash, for example Your post processor settings would be "postprocessors": [
{
"name": "metadata",
"mode": "custom",
"filename": "info.json",
"content-format": "{{ \n\n \"Id\": \"{gallery_id}\", \n \"Tags\": \"{tags}\" \n\n }}"
}
] There is also a And there is also the option to use a template file, where you write the entire format string to a different file and don't have to worry about escaping anything except
Are you sure? Shouldn't it be |
Beta Was this translation helpful? Give feedback.
To use double quotes inside a double-quoted string, you have to escape the quote with a backslash, for example
"… \"Tags\": \"{tags}\" …"
Your post processor settings would be
There is also a
j
conversion, that produces a JSON parseable form of a value (see docs/formatting.md#conversions)For example
{tags!j}
would become["tag1", "tag2", "tag3"]
And there is also the option to use a template file, where you write the entire format string to a different file and don't have to w…