![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 981
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Cloudfare problem
Hi everyone.
I have a plugin called Skoob Sync. It uses webscraping to sync the user info. Now, the site started using Cloudfare when you try to login, giving me a 'HTTP Error 403: Forbidden'. The metadata plugin (Skoob Books) is not affected as it does not need to login. I know this is not a calibre question, but since many of the plugin developers use webscraping, I thought that I might get some help here. Is there any way to bypass the Cloudfare check? This is the relevant code for login: Spoiler:
Spoiler:
Last edited by thiago.eec; 08-24-2024 at 12:49 PM. |
![]() |
![]() |
![]() |
#2 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,485
Karma: 4277235
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I'll offer a few pointers, but I haven't researched it recently.
Cloudfare has more than one level of blocking it can be running at for a given site. Some lower levels can be bypassed with cloudscraper. FlareSolverr is a proxy that runs a headless browser to handle requests. As I understand it, this uses it's own proxy API, not a standard one. Also, this proxy works for web pages, but not images or binaries. I don't believe it works for the highest "under attack" levels of Cloudfare. FanFicFare has code that can use either of these, as well as code that can read cached pages out of your regular browser's cache directory. This is a pain, because you have to load the page in your browser first to cache it--and not all pages are cached. The actual cache reading code isn't mine and I don't pretend to understand it more than superficially. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,255
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@JimmXinu: Just FYI as of calibre 7.17 there is a headless browser (chromium, via Qt WebEngine) in calibre you can use to get URLs. See the WebEngineBrowser class in scraper/qt.py
Last edited by kovidgoyal; Today at 03:03 AM. |
![]() |
![]() |
![]() |
#4 | ||
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 981
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
Quote:
How can I enable full JavaScript and Cookies support for a WebEngineBrowser instance? This is necessary because the Cloudfare check basically gives the browser a few JS calculations to solve, before allowing the user to see the login page. |
||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem! massive problem! | Persian | Calibre | 8 | 07-13-2011 04:39 PM |
PRS-500 battery problem, but the battery's not the problem | ZachC | Sony Reader | 7 | 01-11-2010 11:46 PM |
Calibré problem (may be XP problem) | Hildebrandt | Calibre | 3 | 07-23-2009 02:04 PM |