-
Notifications
You must be signed in to change notification settings - Fork 11
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
HTTPError: 403 Client Error: Forbidden for url: XXX #1
Comments
Using this repo's latest code, that is? Maybe there's geoblocking at play? It works on GitHub Actions (→ https://github.com/NicoWeio/blinkist/runs/6895445085) as well as my machine, so there isn't much I can do about it. You could try logging the response text – maybe it tells you what happened. |
I'm on the latest one I pulled about 15 min ago: During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Well, you don't get a JSON response. Try logging |
Okay. I tried to validate the response.text string and figured out that there is an error in the json file: This is what I get back as response.text
|
That's curious. I don't see an error in the JSON you posted, that is, https://jsonformatter.curiousconcept.com/ doesn't report one. I assume the spaces in e.g. |
Turns out this is Cloudflare. I assumed that cloudscraper would raise |
Alright then, please try again with the latest |
@NicoWeio
BUT wait!! after doing some "definition of insanity" it started working just by running it again a few times even when error come up. Interessting. |
Thanks for your feedback! I actually forgot adding the retry logic to audio downloads. That should be fixed now, so you don't have to “definition of insanity” yourself. ;) |
Hey there, does this kind of error still occur with the latest version of my code? |
yes, then I gave up testing xD |
In my testing, mostly your code works great and I am grateful, but for some reason this particular book throws the same error:
|
Although I have no fix yet, I found some more books that reliably trigger 403 errors:
Maybe there is a pattern? |
@Erik262 @NicoWeio I think I have identified some more giving cloudflare errors, if you would like to test? the-leaders-guide-to-unconscious-bias-en |
Thanks, @2600box! 1.In the web app, one can see that the request goes to the expected URL and works, contrary to a request to the same URL by this code.
2.Providing a valid Therefore…If I don't find an alternative, I will add an option to provide this or to automatically extract it from Firefox in the near future. |
This works, but is not yet configurable, i.e. nothing will work without a valid cookie. A first step towards fixing #1.
This works, but is not yet configurable, i.e. nothing will work without a valid cookie. A first step towards fixing #1.
Thanks for working on this. I tested the new branch with my cookies.sqlite and it worked well. Ideally being able to specify cookies.txt file would be ideal. I also noticed you added the "This book has no audio." which is great. Thanks for continuing this project! |
You're very welcome! Can you elaborate on why a cookies.txt file would be helpful to you? Wouldn't auto-import from all major browsers (to be done) be more comfortable? Of course I could implement both, I just don't see the use case. |
Sure. First, to me it is a more standard approach. Secondly, it is because I prefer to export the cookie for blinkest individually and third I don't run this on the same machine that has my browser. |
This works, but is not yet configurable, i.e. nothing will work without a valid cookie. A first step towards fixing #1.
This works, but is not yet configurable, i.e. nothing will work without a valid cookie. A first step towards fixing #1.
This works, but is not yet configurable, i.e. nothing will work without a valid cookie. A first step towards fixing NicoWeio#1.
That's a good idea. The only reason I didn't to it yet is because support for other browsers seemed so close… and then I never got around to it. As I just wrote in another issue, I hope to get back to this in a month or so. |
I think most of the users are "life-hackers" anyway, they won't mind using Firefox just so that the tool works like a breeze :)) |
I'm getting this error message for example with this link here:
https://www.blinkist.com/api/books/the-automation-advantage-en/chapters
The text was updated successfully, but these errors were encountered: