Skip to content

Commit

Permalink
mgstage: 改进serial (シリーズ)为空时的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuukiy committed Dec 24, 2023
1 parent eaedc84 commit e33e73a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
51 changes: 51 additions & 0 deletions unittest/data/HRV-045 (mgstage).json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"dvdid": "HRV-045",
"cid": null,
"url": "https://www.mgstage.com/product/product_detail/HRV-045/",
"plot": "可愛いボクの妹・綺麗なボクのお姉ちゃん・・豪華女優陣「野々浦暖・長谷川るい・愛音まりあ・瀬戸きらり・結まきな・乙都さきの」6名収録!妹の大人っぽくなって成長したカラダに欲情してしまったボクは、感情を抑えきれず両親に秘密エッチな関係を持つようになり・・・綺麗なお姉ちゃんに誘惑されエッチな手ほどきをされるとボクは興奮し徐々にエスカレートし責めまくる!",
"cover": "https://image.mgstage.com/images/prestige/hrv/045/pb_e_hrv-045.jpg",
"big_cover": null,
"genre": [
"4時間以上作品",
"中出し",
"主観",
"ベスト・総集編",
"姉・妹",
"美少女"
],
"genre_id": null,
"genre_norm": null,
"score": "6.00",
"title": "ボクと姉・妹のエッチな同棲性活。 BEST 8時間 えっちな姉妹と禁断のいちゃラブSEXライフ 野々浦暖 愛音まりあ 長谷川るい 瀬名きらり 結まきな",
"ori_title": null,
"magnet": null,
"serial": null,
"actress": [
"愛音まりあ",
"乙都さきの",
"結まきな",
"瀬名きらり",
"長谷川るい",
"野々浦暖"
],
"actress_pics": null,
"director": null,
"duration": "480",
"producer": "プレステージ",
"publisher": null,
"uncensored": false,
"publish_date": "2020-10-08",
"preview_pics": [
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_0_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_1_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_2_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_3_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_4_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_5_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_6_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_7_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_8_hrv-045.jpg",
"https://image.mgstage.com/images/prestige/hrv/045/cap_e_9_hrv-045.jpg"
],
"preview_video": "https://sample.mgstage.com/sample/prestige/hrv/045/hrv-045_20201006T161301.mp4"
}
7 changes: 4 additions & 3 deletions web/mgstage.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def parse_data(movie: MovieInfo):
dvdid = container.xpath("//th[text()='品番:']/following-sibling::td/text()")[0]
date_str = container.xpath("//th[text()='配信開始日:']/following-sibling::td/text()")[0]
publish_date = date_str.replace('/', '-')
serial = container.xpath("//th[text()='シリーズ:']/following-sibling::td/a/text()")[0].strip()
serial_tag = container.xpath("//th[text()='シリーズ:']/following-sibling::td/a/text()")
if serial_tag:
movie.serial = serial_tag[0].strip()
# label: 大意是某个系列策划用同样的番号,例如ABS打头的番号label是'ABSOLUTELY PERFECT',暂时用不到
# label = container.xpath("//th[text()='レーベル:']/following-sibling::td/text()")[0].strip()
genre_tags = container.xpath("//th[text()='ジャンル:']/following-sibling::td/a")
Expand Down Expand Up @@ -94,7 +96,6 @@ def parse_data(movie: MovieInfo):
movie.actress = actress
movie.producer = producer
movie.publish_date = publish_date
movie.serial = serial
movie.genre = genre
movie.plot = plot
movie.preview_pics = preview_pics
Expand All @@ -106,7 +107,7 @@ def parse_data(movie: MovieInfo):
pretty_errors.configure(display_link=True)
logger.root.handlers[1].level = logging.DEBUG

movie = MovieInfo('SIRO-4718')
movie = MovieInfo('HRV-045')
try:
parse_data(movie)
print(movie)
Expand Down

0 comments on commit e33e73a

Please sign in to comment.