mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
handle referer header when overdrive ID is unknown
This commit is contained in:
parent
a0cdf29379
commit
acb26328c8
@ -23,7 +23,6 @@ from calibre.ebooks.chardet import xml_to_unicode
|
|||||||
from calibre.library.comments import sanitize_comments_html
|
from calibre.library.comments import sanitize_comments_html
|
||||||
|
|
||||||
ovrdrv_data_cache = {}
|
ovrdrv_data_cache = {}
|
||||||
cover_url_cache = {}
|
|
||||||
cache_lock = RLock()
|
cache_lock = RLock()
|
||||||
base_url = 'http://search.overdrive.com/'
|
base_url = 'http://search.overdrive.com/'
|
||||||
|
|
||||||
@ -100,8 +99,10 @@ class OverDrive(Source):
|
|||||||
|
|
||||||
ovrdrv_id = identifiers.get('overdrive', None)
|
ovrdrv_id = identifiers.get('overdrive', None)
|
||||||
br = self.browser
|
br = self.browser
|
||||||
referer = self.get_base_referer()+'ContentDetails-Cover.htm?ID='+ovrdrv_id
|
|
||||||
req = mechanize.Request(cached_url)
|
req = mechanize.Request(cached_url)
|
||||||
|
if ovrdrv_id is not None:
|
||||||
|
referer = self.get_base_referer()+'ContentDetails-Cover.htm?ID='+ovrdrv_id
|
||||||
|
req.add_header('referer', referer)
|
||||||
req.add_header('referer', referer)
|
req.add_header('referer', referer)
|
||||||
log('Downloading cover from:', cached_url)
|
log('Downloading cover from:', cached_url)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user