diff --git a/data/clean/31-2/data.sqlite3 b/data/clean/31-2/data.sqlite3 index ea9b777..c118d57 100644 Binary files a/data/clean/31-2/data.sqlite3 and b/data/clean/31-2/data.sqlite3 differ diff --git a/data/convert/31-2/melee.py b/data/convert/31-2/melee.py index 19c667c..26463db 100755 --- a/data/convert/31-2/melee.py +++ b/data/convert/31-2/melee.py @@ -31,7 +31,10 @@ with db_session: if i["props"]: def replace_props(m): - result = i["props"][m.group(1)] + prop_name = m.group(1) + result = i["props"][prop_name] + if prop_name.startswith("prct"): + result = int(result * 100) if isinstance(result, list): result = result[0] if not isinstance(result, str): diff --git a/data/convert/31-2/ranged.py b/data/convert/31-2/ranged.py index d27112f..6aaefe6 100755 --- a/data/convert/31-2/ranged.py +++ b/data/convert/31-2/ranged.py @@ -35,6 +35,8 @@ with db_session: if prop_name == "ShockAffectDuration": prop_name = "duration" # 雷盾带电手动触发 result = i["props"][prop_name] + if prop_name.startswith("prct"): + result = int(result * 100) if isinstance(result, list): result = result[0] if not isinstance(result, str): diff --git a/data/convert/31-2/shield.py b/data/convert/31-2/shield.py index e3bb0d9..ddf1810 100755 --- a/data/convert/31-2/shield.py +++ b/data/convert/31-2/shield.py @@ -35,6 +35,8 @@ with db_session: if prop_name == "ShockAffectDuration": prop_name = "duration2" # 雷盾带电手动触发 result = i["props"][prop_name] + if prop_name.startswith("prct"): + result = int(result * 100) if isinstance(result, list): result = result[0] if not isinstance(result, str): diff --git a/data/patch/31-2/outfits.py b/data/patch/31-2/outfits.py index 9751511..f06c0d6 100644 --- a/data/patch/31-2/outfits.py +++ b/data/patch/31-2/outfits.py @@ -19,10 +19,16 @@ class OutfitSpider(scrapy.Spider): def parse(self, response): for quote in response.css(".wikitable tbody tr"): name_en = quote.css("td:nth-child(2) > span:last-child::text").get() - preview = quote.css("td:nth-child(6) a::attr('href')").get() if not name_en: + print(name_en) continue - r = requests.get(preview) - with db_session: - w = Outfit.select(name_en=name_en).first() - w.preview = io.BytesIO(r.content).getbuffer().tobytes() + preview = quote.css( + "td:nth-child(6) > span:last-child a::attr('href')" + ).get() + try: + r = requests.get(preview) + with db_session: + w = Outfit.select(name_en=name_en).first() + w.preview = io.BytesIO(r.content).getbuffer().tobytes() + except: + print("Preview not available.") diff --git a/data/render/31-2/output/前线盾.png b/data/render/31-2/output/前线盾.png index d6d72a4..97f3e63 100644 Binary files a/data/render/31-2/output/前线盾.png and b/data/render/31-2/output/前线盾.png differ diff --git a/data/render/31-2/output/均衡之刃.png b/data/render/31-2/output/均衡之刃.png index 8f50828..fbf7f9e 100644 Binary files a/data/render/31-2/output/均衡之刃.png and b/data/render/31-2/output/均衡之刃.png differ diff --git a/data/render/31-2/output/狂暴之刃.png b/data/render/31-2/output/狂暴之刃.png index 626abc7..1abfdd4 100644 Binary files a/data/render/31-2/output/狂暴之刃.png and b/data/render/31-2/output/狂暴之刃.png differ diff --git a/data/render/31-2/output/电鞭.png b/data/render/31-2/output/电鞭.png index 03fbd3e..d427964 100644 Binary files a/data/render/31-2/output/电鞭.png and b/data/render/31-2/output/电鞭.png differ diff --git a/data/render/31-2/output/隼之拳套.png b/data/render/31-2/output/隼之拳套.png index 881cc6c..d9a1606 100644 Binary files a/data/render/31-2/output/隼之拳套.png and b/data/render/31-2/output/隼之拳套.png differ