mikf / gallery-dl

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

Is there a way to "randomize" the sleep/sleep-request function? #5860

Closed jojo2833432 closed 1 month ago

jojo2833432 commented 1 month ago

Hello, I have been having some of my twitter accounts suspended even with -sleep 3-10 and -sleep-request 3-10 include within my command. Even with an account that I "tried" to act human on (Actually using twitter.) got suspended as well. However I'm not sure if this method works.

mikf commented 1 month ago

--sleep 3-10 is already randomized. It chooses a random number of seconds (between 3 and 10) each time it sleeps (check --verbose output).

--sleep and --sleep-request alone are not enough to keep Twitter from suspending your account it seems, but I also can't tell you what is. Maybe using a more up-to-date User-Agent helps, maybe using the same User-Agent as the browser you got your cookies from if you're not using username & password login does something.

jojo2833432 commented 1 month ago

Wait? so I'd just put. "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/123.45 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/123.54", into my config file right? and how would I "constantly" update this? Just copy and paste this from my developer console from chrome every once and awhile?

Hrxn commented 1 month ago

Not sure if you just meant this as an example, but [..] Chrome/123.0.0.0 [..] is not recent anymore, Chrome stable is 127.0.0.0 now.

But yes, you'd need to update that manually. It could only be "enhanced" with reading a user-agent string from your environment variables or something like that - but then you would still need to make sure that your environment variables are updated correctly.

Just copy and paste this from my developer console from chrome every once and awhile?

So, yes. But it's really not a big deal, the cycle is once every 6-8 weeks.

mikf commented 1 month ago

and how would I "constantly" update this?

You could give "user-agent": "browser" a try. This will use the User-Agent string of your default browser (extractor.user-agent).

And absolutely no guarantees that sending the "correct" User-Agent does anything, but it's hopefully better than nothing.

jojo2833432 commented 1 month ago

Ok, So I have it like this on the very top of my .conf file:

`{

 "extractor":
    {

        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
        "base-directory": "./",
        "deviantart":`

Again this is just a snippet, but this is how I'd apply it right?

mikf commented 1 month ago

Yes.

jojo2833432 commented 1 month ago

thanks!