Skip to content

Custom Site Support Example: Gelbooru

HRXN edited this page Feb 3, 2022 · 3 revisions

Example configuration file: Gelbooru_v01 and Gelbooru_v02

{
    "extractor":
    {
        "base-directory": "~/gallery-dl/",
        "archive": "~/gallery-dl/archive.sqlite3",

        "keywords": {"bkey": "", "ckey": ""},
        "keywords-default": "",

        "gelbooru_v01":
        {
            "allgirlbooru": {"root": "https://allgirl.booru.org"},
            "tag":
            {
                "directory": {
                    "locals().get('bkey')": ["Booru", "AllGirlBooru", "Tags", "{bkey}", "{ckey}", "{search_tags}"],
                    ""                    : ["Booru", "AllGirlBooru", "Tags", "_Unsorted", "{search_tags}"]
                }
            },
            "post":
            {
                "directory": ["Booru", "AllGirlBooru", "Posts"]
            },
            "archive": "~/gallery-dl/custom-archive-file-for-gelbooru_v01_instances.db",
            "filename": "{tags}_{id}_{md5}.{extension}",
            "sleep-request": [0, 1.2]
        },

        "gelbooru_v02":
        {
            "tbib": {"root": "https://tbib.org"},
            "tag":
            {
                "directory": {
                    "locals().get('bkey')": ["Other Boorus", "TBIB", "Tags", "{bkey}", "{ckey}", "{search_tags}"],
                    ""                    : ["Other Boorus", "TBIB", "Tags", "_Unsorted", "{search_tags}"]
                }
            },
            "pool":
            {
                "directory": {
                    "locals().get('bkey')": ["Other Boorus", "TBIB", "Pools", "{bkey}", "{ckey}", "{pool}"],
                    ""                    : ["Other Boorus", "TBIB", "Pools", "_Unsorted", "{pool}"]
                }
            },
            "favorite":
            {
                "directory": {
                    "locals().get('bkey')": ["Other Boorus", "TBIB", "Favorites", "{bkey}", "{ckey}", "{favorite_id}"],
                    ""                    : ["Other Boorus", "TBIB", "Favorites", "_Unsorted", "{favorite_id}"]
                }
            },
            "post":
            {
                "directory": ["Other Boorus", "TBIB", "Posts"]
            },
            "archive": "~/gallery-dl/custom-archive-file-for-gelbooru_v02_instances.db",
            "filename": "{id}_{md5}.{extension}",
            "sleep-request": [0, 1.2],
            "username": "YourUsernameHere",
            "password": "YourPasswordHere"
        }
    },

    "downloader":
    {
        "ytdl":
        {
            "module": "yt_dlp"
        }
    },

    "output":
    {
        "logfile": {
            "path": "~/gallery-dl/log.txt",
            "mode": "w",
            "level": "debug"
        }
    }
}