KODI评分显示投票人数

This commit is contained in:
lededev
2022-03-27 20:38:36 +08:00
parent 8d3ee88cde
commit 761fc762f2
2 changed files with 16 additions and 7 deletions

View File

@@ -175,7 +175,8 @@ def getSeries(html):
def getUserRating(html):
try:
result = str(html.xpath('//span[@class="score-stars"]/../text()')[0])
return result[:result.find('')].strip()
v = re.findall(r'(\d+|\d+\.\d+)分, 由(\d+)人評價', result)
return float(v[0][0]), int(v[0][1])
except:
return
@@ -302,8 +303,9 @@ def main(number):
}
userrating = getUserRating(lx)
if userrating:
dic['userrating'] = userrating
if isinstance(userrating, tuple) and len(userrating) == 2:
dic['用户评分'] = userrating[0]
dic['评分人数'] = userrating[1]
if not dic['actor'] and re.match(r'FC2-[\d]+', number, re.A):
dic['actor'].append('素人')
if not dic['series']: