mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-09 05:21:13 +02:00
Don't use mobile User-Agents with cloudscraper--adapter_fanfictionnet doesn't handle mobile pages.
This commit is contained in:
parent
c6cafa87f2
commit
a2607ffa54
1 changed files with 9 additions and 1 deletions
|
|
@ -1073,7 +1073,15 @@ class Configuration(ConfigParser):
|
|||
|
||||
def get_scraper(self):
|
||||
if not self.scraper:
|
||||
self.scraper = cloudscraper.CloudScraper()
|
||||
## ffnet adapter can't parse mobile output, so we only
|
||||
## want desktop browser. But cloudscraper then insists on
|
||||
## a browser and platform, too.
|
||||
self.scraper = cloudscraper.CloudScraper(browser={
|
||||
'browser': 'chrome',
|
||||
'platform': 'windows',
|
||||
'mobile': False,
|
||||
'desktop': True,
|
||||
})
|
||||
## CloudScraper is subclass of requests.Session.
|
||||
## probably need import higher up if ever used.
|
||||
# import requests
|
||||
|
|
|
|||
Loading…
Reference in a new issue