mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update economist_news.recipe
This commit is contained in:
parent
17d9a31d66
commit
98fb801e8a
@ -3,6 +3,7 @@
|
||||
|
||||
import json
|
||||
import time
|
||||
from uuid import uuid4
|
||||
from datetime import datetime, timedelta
|
||||
from urllib.parse import quote, urlencode
|
||||
|
||||
@ -191,10 +192,9 @@ class EconomistNews(BasicNewsRecipe):
|
||||
self.oldest_article = float(d)
|
||||
|
||||
def get_browser(self, *args, **kwargs):
|
||||
# Needed to bypass cloudflare
|
||||
kwargs['user_agent'] = 'common_words/based'
|
||||
kwargs['user_agent'] = 'TheEconomist-Lamarr-android'
|
||||
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
|
||||
br.addheaders += [('Accept-Language', 'en-GB,en-US;q=0.9,en;q=0.8')]
|
||||
br.addheaders += [('x-request-id', str(uuid4()))]
|
||||
return br
|
||||
|
||||
def economist_return_index(self, ans):
|
||||
|
Loading…
x
Reference in New Issue
Block a user