mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Switch to using arandom user agent for amazon metadata downloads
Amazon seems to have started requiring captcha instantly for the IE 11 user agent
This commit is contained in:
parent
5d35c23c5e
commit
232053571e
@ -12,7 +12,7 @@ from threading import Thread
|
|||||||
from Queue import Queue, Empty
|
from Queue import Queue, Empty
|
||||||
|
|
||||||
|
|
||||||
from calibre import as_unicode
|
from calibre import as_unicode, random_user_agent
|
||||||
from calibre.ebooks.metadata import check_isbn
|
from calibre.ebooks.metadata import check_isbn
|
||||||
from calibre.ebooks.metadata.sources.base import (Source, Option, fixcase,
|
from calibre.ebooks.metadata.sources.base import (Source, Option, fixcase,
|
||||||
fixauthors)
|
fixauthors)
|
||||||
@ -831,8 +831,7 @@ class Amazon(Source):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def user_agent(self):
|
def user_agent(self):
|
||||||
# IE 11 - windows 7
|
return random_user_agent(allow_ie=False)
|
||||||
return 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko'
|
|
||||||
|
|
||||||
def save_settings(self, *args, **kwargs):
|
def save_settings(self, *args, **kwargs):
|
||||||
Source.save_settings(self, *args, **kwargs)
|
Source.save_settings(self, *args, **kwargs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user