mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Amazon metadata download: Fix download of ratings not working from amazon.co.jp
This commit is contained in:
parent
1f6072c886
commit
fe6e4e59ea
@ -299,6 +299,7 @@ class Worker(Thread): # Get details {{{
|
|||||||
self.ratings_pat = re.compile(
|
self.ratings_pat = re.compile(
|
||||||
r'([0-9.,]+) ?(out of|von|van|su|étoiles sur|つ星のうち|de un máximo de|de) ([\d\.]+)( (stars|Sternen|stelle|estrellas|estrelas|sterren)){0,1}')
|
r'([0-9.,]+) ?(out of|von|van|su|étoiles sur|つ星のうち|de un máximo de|de) ([\d\.]+)( (stars|Sternen|stelle|estrellas|estrelas|sterren)){0,1}')
|
||||||
self.ratings_pat_cn = re.compile('平均([0-9.]+)')
|
self.ratings_pat_cn = re.compile('平均([0-9.]+)')
|
||||||
|
self.ratings_pat_jp = re.compile(r'\d+つ星のうち([\d\.]+)')
|
||||||
|
|
||||||
lm = {
|
lm = {
|
||||||
'eng': ('English', 'Englisch', 'Engels'),
|
'eng': ('English', 'Englisch', 'Engels'),
|
||||||
@ -575,6 +576,10 @@ class Worker(Thread): # Get details {{{
|
|||||||
m = self.ratings_pat_cn.match(t)
|
m = self.ratings_pat_cn.match(t)
|
||||||
if m is not None:
|
if m is not None:
|
||||||
return float(m.group(1))
|
return float(m.group(1))
|
||||||
|
elif self.domain == 'jp':
|
||||||
|
m = self.ratings_pat_jp.match(t)
|
||||||
|
if m is not None:
|
||||||
|
return float(m.group(1))
|
||||||
else:
|
else:
|
||||||
ans = parse_ratings_text(t)
|
ans = parse_ratings_text(t)
|
||||||
if ans is not None:
|
if ans is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user