mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-24 02:26:01 +01:00
Fix book urls not working after site changes
This commit is contained in:
parent
97049952cc
commit
6a65b7f5c0
1 changed files with 6 additions and 3 deletions
|
|
@ -56,9 +56,12 @@ def search(self, query, max_results=10, timeout=60):
|
|||
if counter <= 0:
|
||||
break
|
||||
|
||||
id = ''.join(data.xpath('.//span[contains(@class, "image")]/a/@href'))
|
||||
if not id:
|
||||
id_ = ''.join(data.xpath('.//span[contains(@class, "image")]/a/@href'))
|
||||
if not id_:
|
||||
continue
|
||||
if id_.startswith('/gb'):
|
||||
id_ = id_[3:]
|
||||
id_ = 'http://uk.nook.com' + id_.strip()
|
||||
|
||||
cover_url = ''.join(data.xpath('.//span[contains(@class, "image")]//img/@data-src'))
|
||||
|
||||
|
|
@ -77,7 +80,7 @@ def search(self, query, max_results=10, timeout=60):
|
|||
s.title = title.strip()
|
||||
s.author = author.strip()
|
||||
s.price = price.strip()
|
||||
s.detail_item = 'http://uk.nook.com/' + id.strip()
|
||||
s.detail_item = id_
|
||||
s.drm = SearchResult.DRM_UNKNOWN
|
||||
s.formats = 'Nook'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue