From a31c5b90aeb5df7947e95ba45246381420b10f76 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 25 Mar 2018 14:22:38 +0530 Subject: [PATCH] Update amazon metadata plugin for a website change --- src/calibre/ebooks/metadata/sources/amazon.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index 59c9924f18..84eb58120b 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -486,12 +486,16 @@ class Worker(Thread): # Get details {{{ return ans def parse_authors(self, root): - matches = tuple(self.selector('#byline .author .contributorNameID')) - if not matches: - matches = tuple(self.selector('#byline .author a.a-link-normal')) - if matches: - authors = [self.totext(x) for x in matches] - return [a for a in authors if a] + for sel in ( + '#byline .author .contributorNameID', + '#byline .author a.a-link-normal', + '#bylineInfo .author .contributorNameID', + '#bylineInfo .author a.a-link-normal' + ): + matches = tuple(self.selector(sel)) + if matches: + authors = [self.totext(x) for x in matches] + return [a for a in authors if a] x = '//h1[contains(@class, "parseasinTitle")]/following-sibling::span/*[(name()="a" and @href) or (name()="span" and @class="contributorNameTrigger")]' aname = root.xpath(x) @@ -835,7 +839,7 @@ class Worker(Thread): # Get details {{{ class Amazon(Source): name = 'Amazon.com' - version = (1, 2, 0) + version = (1, 2, 1) minimum_calibre_version = (2, 82, 0) description = _('Downloads metadata and covers from Amazon')