mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Amazon metadata download: Handle books whose titles start with a bracket. Fixes #976365 (metadata not importing)
This commit is contained in:
parent
a4147c00fd
commit
ea2e70f502
@ -347,7 +347,10 @@ class Worker(Thread): # Get details {{{
|
|||||||
method='text').strip()
|
method='text').strip()
|
||||||
else:
|
else:
|
||||||
title = self.tostring(tdiv, encoding=unicode, method='text').strip()
|
title = self.tostring(tdiv, encoding=unicode, method='text').strip()
|
||||||
return re.sub(r'[(\[].*[)\]]', '', title).strip()
|
ans = re.sub(r'[(\[].*[)\]]', '', title).strip()
|
||||||
|
if not ans:
|
||||||
|
ans = title.rpartition('[')[0].strip()
|
||||||
|
return ans
|
||||||
|
|
||||||
def parse_authors(self, root):
|
def parse_authors(self, root):
|
||||||
x = '//h1[contains(@class, "parseasinTitle")]/following-sibling::span/*[(name()="a" and @href) or (name()="span" and @class="contributorNameTrigger")]'
|
x = '//h1[contains(@class, "parseasinTitle")]/following-sibling::span/*[(name()="a" and @href) or (name()="span" and @class="contributorNameTrigger")]'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user