mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Update economist.recipe
This commit is contained in:
parent
d2839c7aaa
commit
7132743a5e
@ -4,6 +4,7 @@
|
|||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
from uuid import uuid4
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from urllib.parse import quote, urlencode
|
from urllib.parse import quote, urlencode
|
||||||
@ -254,10 +255,9 @@ class Economist(BasicNewsRecipe):
|
|||||||
)
|
)
|
||||||
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
|
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
# Needed to bypass cloudflare
|
kwargs['user_agent'] = 'TheEconomist-Lamarr-android'
|
||||||
kwargs['user_agent'] = 'common_words/based'
|
|
||||||
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
|
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
|
return br
|
||||||
|
|
||||||
def publication_date(self):
|
def publication_date(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user