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

Pixiv - separating r18 content #595

Closed Qwerty-Space closed 4 years ago

Qwerty-Space commented 4 years ago

Hello,

When ripping an artist, I would like to download r-18 content to a separate directory, or omit it all together. How would I go about this?

mikf commented 4 years ago

The relevant metadata entries appear to be x_restrict and sanity_level (see https://github.com/DIYgod/RSSHub/issues/2932#issuecomment-536848808)

You can use those keys in a directory format string to download r-18 content into a separate directory, although those directories will be named 0 and 1, or use them to ignore/omit files with --filter:

$ gallery-dl --filter "not x_restrict" https://www.pixiv.net/en/users/11
$ gallery-dl --filter "sanity_level < 4" https://www.pixiv.net/en/users/11

You can also test if "R-18" or "R-18G" is a tag:

$ gallery-dl --filter "'R-18' not in tags and 'R-18G' not in tags" https://www.pixiv.net/en/users/11
Qwerty-Space commented 4 years ago

How would I check for tags in the config.json?

mikf commented 4 years ago

image-filter - its the config file equivalent of --filter.

Qwerty-Space commented 4 years ago

Thanks.

But I can't set a separate directory for that? I was thinking of something like


"pixiv": 
{
    "directory": "...",
    "r-18":
    {
        "directory": "..."
    }
}
Qwerty-Space commented 4 years ago

I tried doing something like this, but I just get a directory named None

"directory": ["{user[account]} ({user[id]})", "{'R-18' if x_restrict else 'SFW'}", "{date}", "{id} {title}"]

Qwerty-Space commented 4 years ago

Would you prefer to talk on gitter?

Qwerty-Space commented 4 years ago

Current solution is {x_restrict!S:R1/R-18/}. This replaces x_restrict with a value of 1 with R-18, and x_restrict 0 will just go in the main directory.

However x_restrict 2 will go into a directory called 2

For example

Pixiv\
  SFW-artwork
  R-18\
    NSFW-artwork
  2\
    NSFW-gore-artwork
mikf commented 4 years ago

Todo:

possibly more, but these are at least "easy"