mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 04:13:39 +02:00
Amazon metadata download: Update plugin to handle changes to Amazon site that could cause some covers to not be downloaded. Also fix finding metadata for books with + in their titles.
This commit is contained in:
parent
452886aedd
commit
58e933f394
2 changed files with 9 additions and 2 deletions
|
|
@ -452,7 +452,7 @@ def parse_series(self, root):
|
|||
|
||||
|
||||
def parse_cover(self, root):
|
||||
imgs = root.xpath('//img[(@id="prodImage" or @id="original-main-image") and @src]')
|
||||
imgs = root.xpath('//img[(@id="prodImage" or @id="original-main-image" or @id="main-image") and @src]')
|
||||
if imgs:
|
||||
src = imgs[0].get('src')
|
||||
if '/no-image-avail' not in src:
|
||||
|
|
@ -895,6 +895,13 @@ def download_cover(self, log, result_queue, abort, # {{{
|
|||
isbn_test, title_test, authors_test, comments_test, series_test)
|
||||
com_tests = [ # {{{
|
||||
|
||||
( # + in title and uses id="main-image" for cover
|
||||
{'title':'C++ Concurrency in Action'},
|
||||
[title_test('C++ Concurrency in Action: Practical Multithreading',
|
||||
exact=True),
|
||||
]
|
||||
),
|
||||
|
||||
( # Series
|
||||
{'identifiers':{'amazon':'0756407117'}},
|
||||
[title_test(
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ def get_title_tokens(self, title, strip_joiners=True, strip_subtitle=False):
|
|||
# Remove single quotes not followed by 's'
|
||||
(r"'(?!s)", ''),
|
||||
# Replace other special chars with a space
|
||||
(r'''[:,;+!@$%^&*(){}.`~"\s\[\]/]''', ' '),
|
||||
(r'''[:,;!@$%^&*(){}.`~"\s\[\]/]''', ' '),
|
||||
]]
|
||||
|
||||
for pat, repl in title_patterns:
|
||||
|
|
|
|||
Loading…
Reference in a new issue