mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update spectator_magazine.recipe
This commit is contained in:
parent
36e08bd767
commit
46f0877f7e
@ -46,10 +46,14 @@ class spectator(BasicNewsRecipe):
|
|||||||
fc['id'] = 'fig-c'
|
fc['id'] = 'fig-c'
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
# the print_version loads all articles but sometimes it might fail due to too many requests
|
def get_browser(self, *args, **kwargs):
|
||||||
def print_version(self, url):
|
kwargs['user_agent'] = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
|
||||||
from urllib.parse import quote
|
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
|
||||||
return 'https://webcache.googleusercontent.com/search?q=cache:' + quote(url, safe='')
|
br.addheaders += [
|
||||||
|
('Referer', 'https://www.google.com/'),
|
||||||
|
('X-Forwarded-For', '66.249.66.1')
|
||||||
|
]
|
||||||
|
return br
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
soup = self.index_to_soup('https://www.spectator.co.uk/magazine')
|
soup = self.index_to_soup('https://www.spectator.co.uk/magazine')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user