JavDB: add User Rating to .NFO
This commit is contained in:
@@ -172,6 +172,12 @@ def getSeries(html):
|
||||
result1 = str(html.xpath('//strong[contains(text(),"系列")]/../span/text()')).strip(" ['']")
|
||||
result2 = str(html.xpath('//strong[contains(text(),"系列")]/../span/a/text()')).strip(" ['']")
|
||||
return str(result1 + result2).strip('+').replace("', '", '').replace('"', '')
|
||||
def getUserRating(html):
|
||||
try:
|
||||
result = str(html.xpath('//span[@class="score-stars"]/../text()')[0])
|
||||
return result[:result.find('分')].strip()
|
||||
except:
|
||||
return
|
||||
|
||||
def main(number):
|
||||
# javdb更新后同一时间只能登录一个数字站,最新登录站会踢出旧的登录,因此按找到的第一个javdb*.json文件选择站点,
|
||||
@@ -295,6 +301,9 @@ def main(number):
|
||||
'series': getSeries(lx),
|
||||
|
||||
}
|
||||
userrating = getUserRating(lx)
|
||||
if userrating is not None:
|
||||
dic['userrating'] = userrating
|
||||
if not dic['actor'] and re.match(r'FC2-[\d]+', number, re.A):
|
||||
dic['actor'].append('素人')
|
||||
if not dic['series']:
|
||||
@@ -324,7 +333,7 @@ if __name__ == "__main__":
|
||||
# print(main('FC2-1174949')) # not found
|
||||
#print(main('MVSD-439'))
|
||||
# print(main('EHM0001')) # not found
|
||||
print(main('FC2-2314275'))
|
||||
#print(main('FC2-2314275'))
|
||||
# print(main('EBOD-646'))
|
||||
# print(main('LOVE-262'))
|
||||
#print(main('ABP-890'))
|
||||
print(main('ABP-890'))
|
||||
|
||||
2
core.py
2
core.py
@@ -354,6 +354,8 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
|
||||
print(" <premiered>" + release + "</premiered>", file=code)
|
||||
print(" <releasedate>" + release + "</releasedate>", file=code)
|
||||
print(" <release>" + release + "</release>", file=code)
|
||||
if 'userrating' in json_data:
|
||||
print(" <userrating>" + json_data['userrating'] + "</userrating>", file=code)
|
||||
print(" <cover>" + cover + "</cover>", file=code)
|
||||
if config.getInstance().is_trailer():
|
||||
print(" <trailer>" + trailer + "</trailer>", file=code)
|
||||
|
||||
Reference in New Issue
Block a user