Topic: Banned from API when using python's urllib to open post url

Posted under e621 Tools and Applications

I designed myself a python script to backup my favorites to a local drive every so often automatically, but it's kinda of clunky so I decided to rewrite it for user friendliness and to make it public. But during testing of attempting to open a post's URL through python's urllib it kindly informed me that "The owner of the website has banned your access based on your browser's signature" and what looks like a hash. And now I can't access the API what so ever. Why was I banned? I'd really, really like my API access back as this has been a long project for me and I really don't want to just throw it away.

Updated

Eri_Boden said:
I designed myself a python script to backup my favorites to a local drive every so often automatically, but it's kinda of clunky so I decided to rewrite it for user friendliness and to make it public. But during testing of attempting to open a post's URL through python's urllib it kindly informed me that "The owner of the website has banned your access based on your browser's signature" and what looks like a hash. And now I can't access the API what so ever. Why was I banned? I'd really, really like my API access back as this has been a long project for me and I really don't want to just throw it away.

This was not an action that was taken manually. Most likely cloudflare has banned the urllib user agent because somebody was using that user agent string to hit a(our?) site at an unreasonably high request rate.

Take a look at the user-agent note near the top of https://e621.net/wiki/show/e621:api and change the user agent for your tool. This should allow you API access again. Do NOT impersonate a browser user agent, as that can result in automated blocking by cloudflare.

Updated by anonymous

KiraNoot said:
This was not an action that was taken manually. Most likely cloudflare has banned the urllib user agent because somebody was using that user agent string to hit a(our?) site at an unreasonably high request rate.

Take a look at the user-agent note near the top of https://e621.net/wiki/show/e621:api and change the user agent for your tool. This should allow you API access again. Do NOT impersonate a browser user agent, as that can result in automated blocking by cloudflare.

Thanks for the quick response and the info! I'll get to working on this.

EDIT: That did the trick! Thanks tons, I was about to get super bummed out.

Updated by anonymous

  • 1