uodate econ

This commit is contained in:
unkn0w7n 2024-12-01 13:15:48 +05:30
parent 0808abe952
commit ef995a1ec5
5 changed files with 8 additions and 12 deletions

View File

@ -250,10 +250,9 @@ class Economist(BasicNewsRecipe):
def get_browser(self, *args, **kwargs):
if self.from_archive:
kwargs['user_agent'] = (
'Mozilla/5.0 (Linux; Android 14; 330333QCG Build/AP1A.140705.005; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.165 Mobile Safari/537.36 Lamarr/3.37.0-3037003 (android)' # noqa
'Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36 Lamarr' # noqa
)
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
br.addheaders += [('x-requested-with', 'com.economist.lamarr')]
else:
# Needed to bypass cloudflare
kwargs['user_agent'] = 'common_words/based'

View File

@ -250,10 +250,9 @@ class Economist(BasicNewsRecipe):
def get_browser(self, *args, **kwargs):
if self.from_archive:
kwargs['user_agent'] = (
'Mozilla/5.0 (Linux; Android 14; 330333QCG Build/AP1A.140705.005; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.165 Mobile Safari/537.36 Lamarr/3.37.0-3037003 (android)' # noqa
'Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36 Lamarr' # noqa
)
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
br.addheaders += [('x-requested-with', 'com.economist.lamarr')]
else:
# Needed to bypass cloudflare
kwargs['user_agent'] = 'common_words/based'

View File

@ -158,10 +158,9 @@ class econ_search(BasicNewsRecipe):
def get_browser(self, *args, **kwargs):
kwargs['user_agent'] = (
'Mozilla/5.0 (Linux; Android 14; 330333QCG Build/AP1A.140705.005; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.165 Mobile Safari/537.36 Lamarr/3.37.0-3037003 (android)' # noqa
'Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36 Lamarr' # noqa
)
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
br.addheaders += [('x-requested-with', 'com.economist.lamarr')]
return br
def preprocess_raw_html(self, raw, url):

View File

@ -178,10 +178,9 @@ class EconomistWorld(BasicNewsRecipe):
def get_browser(self, *args, **kwargs):
kwargs['user_agent'] = (
'Mozilla/5.0 (Linux; Android 14; 330333QCG Build/AP1A.140705.005; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.165 Mobile Safari/537.36 Lamarr/3.37.0-3037003 (android)' # noqa
'Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.6533.103 Mobile Safari/537.36 Lamarr' # noqa
)
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
br.addheaders += [('x-requested-with', 'com.economist.lamarr')]
return br
def economist_test_article(self):

View File

@ -41,8 +41,8 @@ class Substack(BasicNewsRecipe):
recipe_specific_options = {
'auths': {
'short': 'enter the @handles you subscribe to:\nseperated by a space',
'long': 'julianmacfarlane ianleslie .... ....',
'default': 'julianmacfarlane ianleslie thesalvo',
'long': '@julianmacfarlane @simplicius76 .... ....',
'default': '@julianmacfarlane @simplicius76 @caitlinjohnstone @michaelmoore @seymourhersh @robertreich',
},
'days': {
'short': 'Oldest article to download from this news source. In days ',
@ -93,8 +93,8 @@ class Substack(BasicNewsRecipe):
ans = []
u = self.recipe_specific_options.get('auths')
if u and isinstance(u, str):
for x in u.split():
ans.append('https://' + x.replace('@', '') + '.substack.com/feed')
for x in u.replace('@', ' ').split():
ans.append('https://' + x + '.substack.com/feed')
return ans
def preprocess_html(self, soup):