# -*- coding: utf-8 -*- import re from lxml import etree from . import httprequest from .parser import Parser class Jav321(Parser): source = 'jav321' expr_title = "/html/body/div[2]/div[1]/div[1]/div[1]/h3/text()" expr_cover = "/html/body/div[2]/div[2]/div[1]/p/a/img/@src" expr_outline = "/html/body/div[2]/div[1]/div[1]/div[2]/div[3]/div/text()" # NOTE: 统一使用 xpath expr_number = '//b[contains(text(),"品番")]/following-sibling::node()' expr_actor = '//b[contains(text(),"出演者")]/following-sibling::a[starts-with(@href,"/star")]' expr_label = '//b[contains(text(),"メーカー")]/following-sibling::a[starts-with(@href,"/company")]' expr_tags = '//b[contains(text(),"ジャンル")]/following-sibling::a[starts-with(@href,"/genre")]' expr_studio = '//b[contains(text(),"メーカー")]/following-sibling::a[starts-with(@href,"/company")]' expr_release = '//b[contains(text(),"配信開始日")]/following-sibling::node()' expr_runtime = '//b[contains(text(),"収録時間")]/following-sibling::node()' # expr_series = '//b[contains(text(),"シリーズ")]' def queryNumberUrl(self, number): return 'https://www.jav321.com/search' def getHtmlTree(self, url): resp = httprequest.post(url, data={"sn": self.number}, cookies=self.cookies, proxies=self.proxies, verify=self.verify) if "/video/" in resp.url: self.detailurl = resp.url self.detailhtml = resp.text return etree.fromstring(resp.text, etree.HTMLParser()) return None def getNum(self, htmltree): return super().getNum(htmltree).split(": ")[1] def getTrailer(self, htmltree): videourl_pather = re.compile(r'
[\s\S]*?