mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-05-31 02:55:19 -04:00
Merge branch 'tls-safari-ua' of https://github.com/claybdavis/calibre
This commit is contained in:
@@ -44,6 +44,17 @@ class TLS(BasicNewsRecipe):
|
||||
}
|
||||
}
|
||||
|
||||
def get_browser(self, *args, **kwargs):
|
||||
# Default Chrome UA is served a CloudFront CAPTCHA page that
|
||||
# lacks the rel=shortlink Link header parse_index needs to
|
||||
# extract the WordPress issue id. Safari UA gets the real page.
|
||||
kwargs['user_agent'] = (
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
|
||||
'AppleWebKit/605.1.15 (KHTML, like Gecko) '
|
||||
'Version/17.0 Safari/605.1.15'
|
||||
)
|
||||
return BasicNewsRecipe.get_browser(self, *args, **kwargs)
|
||||
|
||||
def parse_index(self):
|
||||
issue = 'https://www.the-tls.com/issues/current-issue/'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user