Update Amazon metadata download plugin for changes to amazon results page markup

This commit is contained in:
Kovid Goyal 2019-03-08 05:17:22 +05:30
parent 30d0b71027
commit 293571cb8a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -842,7 +842,7 @@ class Worker(Thread): # Get details {{{
class Amazon(Source):
name = 'Amazon.com'
version = (1, 2, 5)
version = (1, 2, 6)
minimum_calibre_version = (2, 82, 0)
description = _('Downloads metadata and covers from Amazon')
@ -1157,7 +1157,10 @@ class Amazon(Source):
return False
return True
for a in root.xpath(r'//li[starts-with(@id, "result_")]//a[@href and contains(@class, "s-access-detail-page")]'):
result_links = root.xpath('//div[contains(@class, "s-result-list")]//div[@data-index]//h5//a[@href]')
if not result_links:
result_links = root.xpath(r'//li[starts-with(@id, "result_")]//a[@href and contains(@class, "s-access-detail-page")]')
for a in result_links:
title = tostring(a, method='text', encoding=unicode)
if title_ok(title):
url = a.get('href')