mikf / gallery-dl

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

Add e621/926/6ai tag blacklist feature to config file. #6267

Open plshelpidkwhatimdoing opened 3 weeks ago

plshelpidkwhatimdoing commented 3 weeks ago

Would it be possible to add a tag blacklist feature to gallery-dl's config file? I know gallery-dl can see the tags as if I run gallery-dl -K https://e621.net/posts/3284217 (safe btw, one of my favorite skyrim comics) I'll get something like this in the results

tags['artist'][N]
  0 colarix ...
tags['character'][N]
  0 milfnir ...
tags['copyright'][N]
  0 bethesda_game_studios ...
tags['general'][N]
   0 anthro ...
tags['meta'][N]
  0 absurd_res ...
tags['species'][N]
  0 dragon ...

I'm thinking the blacklist could look something like this (if this is possible, I'm not sure)

{
    "e621": {
        "username": username,
        "password": apikey,
        "#": "no idea if postprocessors is the right one, if im wrong pls correct me",
        "postprocessors": [{
                "blacklisted-tags": [{
                    "artist": "somedude1 somedude2",
                    "character": ["characteryoudontlike", "anothercharacter"],
                    "copyright": ["showyouhate", "gameyouhate"],
                    "general": ["somethingyoudontwanttosee" "somethingelse"],
                    "meta": ["absurd_res", "hi_res"],
                    "species": ["speciesyoudontlike", "anotherspecies"]
            }]
    }]}
}

So if I were to put "colarix" in the "artist" section, all posts with colarix as the artist would be skipped. Alternatively if that's not possible, maybe something like this could work

{
    "e621": {
        "username": username,
        "password": apikey,
        "#": "still not sure if postprocessors is correct",
        "postprocessors":[{
            "blacklisted-tagfile": "/path/to/file.txt"
    }]
    }
}

and the tagfile would just have one per line

tag1
tag2...