mikf / gallery-dl

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

Unable to filter correctly saved post by subreddits #5705

Closed kriss6557 closed 2 weeks ago

kriss6557 commented 2 weeks ago

Hi, I'm trying to save images and videos from my saved articles on reddit. In addition I want to filter and only save these from specific subreddits.

I seem to be able to exclude some subreddits, but cannot tell to select a given list of subreddits.

I select the saved articles by using the URL: https://www.reddit.com/user//saved

In the following conf file:

{
    "extractor": {
        "reddit": {
            "client-id": "XXXXXXX",
            "user-agent": "Python:myapp:v1.0 (by /u/username)",
            "refresh-token": "XXXXXXXXXXXXXXXXXX",
            "filename": "{id}_{title}.{extension}",
            "subreddit": {
                "video": true,
                "comments": false,
                "include": ["AAA", "BBB"],
                "exclude": ["CCC", "DDD", "EEE"]
            }
        }
    },
    "output": {
        "mode": "auto",
        "path": "/gallery-dl",
        "progress": true
    },
    "downloader": {
        "http": {
            "rate": "100k",
            "timeout": 30,
            "retries": 4,
            "verify": true
        }
    }
}

It will exclude CCC, DDD, EEE saved posts, but will not save AAA, BBB only, it can save FFF, GGG....

Then I tried:

{
    "extractor": {
        "reddit": {
            "client-id": "XXXXXXX",
            "user-agent": "Python:myapp:v1.0 (by /u/username)",
            "refresh-token": "XXXXXXXXXXXXXXXXXX",
            "filename": "{id}_{title}.{extension}"
        },
        "reddit.subreddit": {
            "AAA": {"saved": true},
            "BBB": {"saved": true}
        }
    },
    "output": {
        "mode": "auto",
        "path": "/gallery-dl",
        "progress": true
    },
    "downloader": {
        "http": {
            "rate": "100k",
            "timeout": 30,
            "retries": 4,
            "verify": true
        }
    }
}

Again it will not stop to only AAA and BBB.

Is there a way to filter and save only saved articles from a given list of subreddits ? Thank you

mikf commented 2 weeks ago

There is no exclude option, and include doesn't do what you expect it to.

To filter file downloads, use image-filter To control which external URLs get processed, use chapter-filter and blacklist/whitelist

kriss6557 commented 2 weeks ago

ok no worries, I worked around this by building my filtered list of posts and provide to gallery-dl