mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 13:03:37 +02:00
Log the user agent and keep it stable
This commit is contained in:
parent
2e693b4156
commit
2d25f8d779
1 changed files with 3 additions and 1 deletions
|
|
@ -502,7 +502,9 @@ def get_browser(self):
|
|||
'''
|
||||
if 'user_agent' not in kwargs:
|
||||
# More and more news sites are serving JPEG XR images to IE
|
||||
kwargs['user_agent'] = random_user_agent(allow_ie=False)
|
||||
kwargs['user_agent'] = self.last_used_user_agent = getattr(
|
||||
self, 'last_used_user_agent', None) or random_user_agent(allow_ie=False)
|
||||
self.log('Using user agent:', kwargs['user_agent'])
|
||||
br = browser(*args, **kwargs)
|
||||
br.addheaders += [('Accept', '*/*')]
|
||||
if self.handle_gzip:
|
||||
|
|
|
|||
Loading…
Reference in a new issue