diff --git a/unittest/data/259LUXU-593 (avwiki).json b/unittest/data/259LUXU-593 (avwiki).json index 0d58ce483..5316f1e2c 100644 --- a/unittest/data/259LUXU-593 (avwiki).json +++ b/unittest/data/259LUXU-593 (avwiki).json @@ -13,7 +13,9 @@ "ori_title": null, "magnet": null, "serial": "ラグジュTV", - "actress": "白咲りの", + "actress": [ + "白咲りの" + ], "actress_pics": null, "director": null, "duration": null, diff --git a/unittest/data/300MIUM-1001 (avwiki).json b/unittest/data/300MIUM-1001 (avwiki).json index ec8e2c75f..974447c49 100644 --- a/unittest/data/300MIUM-1001 (avwiki).json +++ b/unittest/data/300MIUM-1001 (avwiki).json @@ -13,7 +13,9 @@ "ori_title": null, "magnet": null, "serial": "レンタル彼女", - "actress": "沙優七羽", + "actress": [ + "沙優七羽" + ], "actress_pics": null, "director": null, "duration": null, diff --git a/unittest/data/SSIS-698 (avwiki).json b/unittest/data/SSIS-698 (avwiki).json new file mode 100644 index 000000000..8d816ca54 --- /dev/null +++ b/unittest/data/SSIS-698 (avwiki).json @@ -0,0 +1,30 @@ +{ + "dvdid": "SSIS-698", + "cid": null, + "url": "https://av-wiki.net/SSIS-698", + "plot": null, + "cover": "https://pics.dmm.co.jp/digital/video/ssis00698/ssis00698pl.jpg", + "big_cover": null, + "genre": null, + "genre_id": null, + "genre_norm": null, + "score": null, + "title": "三上悠亜と新ありなと相沢みなみ", + "ori_title": null, + "magnet": null, + "serial": null, + "actress": [ + "三上悠亜", + "新ありな", + "相沢みなみ" + ], + "actress_pics": null, + "director": null, + "duration": null, + "producer": "エスワン ナンバーワンスタイル", + "publisher": null, + "uncensored": false, + "publish_date": "2023-05-05", + "preview_pics": null, + "preview_video": null +} \ No newline at end of file diff --git a/web/avwiki.py b/web/avwiki.py index f9dfca8b1..0f245579b 100644 --- a/web/avwiki.py +++ b/web/avwiki.py @@ -46,12 +46,15 @@ def parse_data(movie: MovieInfo): dt_txt_ls, dd_tags = info.xpath("dt/text()"), info.xpath("dd") data = {} for dt_txt, dd in zip(dt_txt_ls, dd_tags): + dt_txt = dt_txt.strip() a_tag = dd.xpath('a') if len(a_tag) == 0: - dd_txt = dd.text + dd_txt = dd.text.strip() else: - dd_txt = a_tag[0].text - data[dt_txt.strip()] = dd_txt.strip() + dd_txt = [i.text.strip() for i in a_tag] + if isinstance(dd_txt, list) and dt_txt != 'AV女優名': # 只有女优名以列表的数据格式保留 + dd_txt = dd_txt[0] + data[dt_txt] = dd_txt ATTR_MAP = {'メーカー': 'producer', 'AV女優名': 'actress', 'メーカー品番': 'dvdid', 'シリーズ': 'serial', '配信開始日': 'publish_date'} for key, attr in ATTR_MAP.items():