mikf / gallery-dl

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

Which settings to avoid getting forcibly logged out/suspended from Twitter? #5775

Open cheatreal321 opened 1 week ago

cheatreal321 commented 1 week ago

So I updated to the latest version 1.27.0 this week and tried to download a bunch of Twitter accounts again with the same config from roughly 5 months ago. After hitting the rate limit a few times, Twitter forcibly logged me out everywhere and I got the known 401 Unauthorized (Could not authenticate you) error cause I was only using browser cookies to log in. This I was able to work around by logging back into my account and adding my username and password to the config for the relogin option to work. However after getting forcibly logged out again and using the gallery-dl relogin a few times, my account was temporarily locked and I had to do the Arkose challenge. I then cleared cache for twitter and added a delay with "sleep": 1, "sleep-request": 1, which was enough to prevent ever hitting rate limit, but I was still eventually logged out, and after triggering the relogin multiple times my account was suspended for trying to evade suspension.

I just got my account unlocked and I still want to download everything I can, but want to avoid having any further troubles. What settings can/should I use to prevent getting forcibly logged out and then suspended? I saw the comments in #5532 saying that upping sleep and sleep-request to 2 seconds is enough, but how reliable is that? Also, could a Premium subscription increase the rate limit at all?

For reference here's my current config that got my account suspended:

{
    "extractor":{
    "cookies": ["firefox"],
        "twitter":{
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0",
        "username": "username",
            "password": "password",
        "base-directory": "G:/twitter_gallery-dl/",
        "users": "https://twitter.com/{legacy[screen_name]}",
            "text-tweets":false,
            "quoted":true,
            "retweets":true,
            "replies":true,
            "logout":true,
        "relogin":true,
        "locked": "wait",
        "ratelimit": "wait:1800",
        "sleep": 1,
        "sleep-request": 1,
            "filename": "{author['name']}-{tweet_id}-{date:%Y%m%d_%H%M%S}-0{num}.{extension}",
            "directory":{
                "quote_id   != 0": ["twitter", "{quote_by}"  , "quote-retweets"],
                "retweet_id != 0": ["twitter", "{user[name]}", "retweets"  ],
                ""               : ["twitter", "{user[name]}"              ]
            },
            "postprocessors":[
                {
            "name": "mtime",
                    "key": "date"
                },
                {   
                    "name": "metadata",
                    "event": "post",
                    "filename": "{author['name']}-{tweet_id}-{date:%Y%m%d_%H%M%S}.json"
                }
            ]
        }
    },
    "downloader": {

    },
    "output": {

    },
    "postprocessor": {

    }
}
a84r7a3rga76fg commented 1 week ago

What did you tell Twitter to get unbanned? I'm also getting banned for evading when I get rate limited.

These are my settings

            "include": ["avatar", "background", "timeline", "media"],
            "image-filter": "author is user",
            "sleep-request": 30,
            "sleep": 5,
            "quoted": true,
            "locked": "wait",
            "twitpic": true,
            "videos": true,
            "cards": false,
            "expand": false,
            "pinned": true,
            "unique": true,
            "skip": true,
            "metadata": true,
cheatreal321 commented 1 week ago

I wrote something short like "Hi, I seem to have been mistakenly suspended cause of an issue with a browser addon that was constantly logging in and out of my account. I thought the emails notifying me of a new login were an error and didn't react in time. I've removed the addon now so it shouldn't happen again. Please unlock the account. Thank you."