-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urllib.error.HTTPError: HTTP Error 403: Forbidden #89
Comments
I had this identical issue while experimenting with TPB API (and Python 3 for that matter). I'm pretty sure the user agent that is set by |
@SIGINT what did you do to 'tpb.py'? |
As a quick hack, I manually set the user agent in """
Request URL and parse response. Yield a ``Torrent`` for every torrent
on page.
"""
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46'
request = urlopen(Request(str(self.url), data=None, headers={'User-Agent': user_agent}))
#request = urlopen(str(self.url)) It was a quick fix to get around the server blocking certain (likely robot) user agents. Hope this helps! |
@SIGINT thanks for the update; I actually found a solution using SickRage. Specifically, this bit of code in (relative to top level directory) sickbeard/providers/thepiratebay.py |
Just as a note make sure you change all the urlopen() calls in case you're still getting 403 errors. |
I am getting the same issue again. Is it solved for everyone? |
When i run it with any request, i get this HTTP error:
This is the code i tried:
The text was updated successfully, but these errors were encountered: