Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two examples for custom instances of gelbooru #2262

Merged
merged 2 commits into from Feb 4, 2022
Merged

Add two examples for custom instances of gelbooru #2262

merged 2 commits into from Feb 4, 2022

Conversation

Hrxn
Copy link
Contributor

@Hrxn Hrxn commented Feb 2, 2022

  • First example uses some custom options at the "gelbooru_v01" basecategory
    These apply to all instances used herein
  • Second example adds all options to the specific "gelbooru_v02" basecategory of TBIB
    These settings are only used by TBIB

If I'm reading that correctly, that is 馃ぃ

Tested this locally with my own config, seems to work though.

- First example uses some custom options at the "gelbooru_v01" basecategory
   These apply to all instances used herein
- Second example adds all options to the specific "gelbooru_v02" basecategory of TBIB
    These settings are only used by TBIB
@Hrxn
Copy link
Contributor Author

Hrxn commented Feb 3, 2022

Well.. I should've double checked against my config file actually in use by the program.

Because it is not entirely correct and not working as described here in this PR.

I was reading this from the example config file, which led me to make an assumption that is apparently not correct.

"mastodon":
{
"#": "add 'tabletop.social' as recognized mastodon instance",
"#": "(run 'gallery-dl oauth:mastodon:tabletop.social to get an access token')",
"tabletop.social":
{
"root": "https://tabletop.social",
"access-token": "513a36c6..."
},
"#": "set filename format strings for all 'mastodon' instances",
"directory": ["mastodon", "{instance}", "{account[username]!l}"],
"filename" : "{id}_{media[id]}.{extension}"
},

Here "access-token" is set at the same level as "root", i.e. as part of/inside of "tabletop.social"

My assumption was that this would also be true for other options in general, like changing the "directory" options etc. as in the PR.

But this is false, so the second example ("gelbooru_v02") is wrong, because the options are set inside "tbib" are not actually used, at least not in my test.

(The example "gelbooru_v01" is still correct (according to my local tests, at least), and working as it is described)

But there is a quick and easy fix:
The closing curly-brace from line 288 can simply be moved in front of the comma in line 252.
Then the syntax should be correct again, and just the whitespace/indentation is a bit off 馃槃

@mikf
Copy link
Owner

mikf commented Feb 4, 2022

Right, to define any regular options for a specific site/category from a basecategory, it has to go into its own category block. For example

    "gelbooru_v02":
    {
        "tbib": { "root": "https://tbib.org" }
    },

    "tbib":
    {
        "tag":
        {
            "#": "",
        },
        "filename": "{id}_{md5}.{extension}"
    },

The access-token values for Mastodon are just a special case, like api-root for Gelbooru v0.2.

@mikf
Copy link
Owner

mikf commented Feb 4, 2022

Also, thank you for this hopefully useful addition and for starting with Wiki entries.

and remove username and password,
since those are not  supported for any gelbooru_v02 instance
@mikf mikf merged commit f4a7c6e into mikf:master Feb 4, 2022
@Hrxn Hrxn deleted the patch-1 branch February 5, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants