From fa9c690e60eac935c3adae575dff31d1f3ba6ab6 Mon Sep 17 00:00:00 2001 From: lededev Date: Thu, 14 Apr 2022 04:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=97=A7.nfo=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E8=AF=84=E5=88=86=E5=8F=8A=E6=8A=95=E7=A5=A8=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=85=83=E6=95=B0=E6=8D=AE=E4=B8=AD=E4=B8=8D?= =?UTF-8?q?=E5=8C=85=E5=90=AB=EF=BC=8C=E5=88=99=E6=90=AC=E8=BF=90=E6=97=A7?= =?UTF-8?q?=E5=88=86=E6=95=B0=E5=92=8C=E6=8A=95=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/core.py b/core.py index a2e7b3d..a0ac1bd 100644 --- a/core.py +++ b/core.py @@ -382,7 +382,22 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f """, file=code) except: - pass + if old_nfo: + try: + for rtag in ('rating', 'criticrating'): + xur = old_nfo.xpath(f'//{rtag}/text()')[0] + if isinstance(xur, str) and re.match('\d+\.\d+|\d+', xur.strip()): + print(f" <{rtag}>{xur.strip()}", file=code) + f_rating = old_nfo.xpath(f"//ratings/rating[@name='javdb']/value/text()")[0] + uc = old_nfo.xpath(f"//ratings/rating[@name='javdb']/votes/text()")[0] + print(f""" + + {f_rating} + {uc} + + """, file=code) + except: + pass print(" " + cover + "", file=code) if config.getInstance().is_trailer(): print(" " + trailer + "", file=code)