javbus, javlib use outline in airav

This commit is contained in:
yoshiko2
2021-04-22 03:22:24 +08:00
parent 98c8585327
commit f761e5bccc
3 changed files with 25 additions and 21 deletions

View File

@@ -7,6 +7,7 @@ from bs4 import BeautifulSoup#need install
import json
from ADC_function import *
from WebCrawler import fanza
import airav
def getActorPhoto(htmlcode): #//*[@id="star_qdt"]/li/a/img
soup = BeautifulSoup(htmlcode, 'lxml')
@@ -79,12 +80,13 @@ def getCID(htmlcode):
string = html.xpath("//a[contains(@class,'sample-box')][1]/@href")[0].replace('https://pics.dmm.co.jp/digital/video/','')
result = re.sub('/.*?.jpg','',string)
return result
def getOutline(htmlcode): #获取演员
html = etree.fromstring(htmlcode, etree.HTMLParser())
def getOutline(number): #获取演员
try:
result = html.xpath("string(//div[contains(@class,'mg-b20 lh4')])").replace('\n','')
response = json.loads(airav.main(number))
result = response['outline']
return result
except:
except Exception as e:
print(e)
return ''
def getSerise(htmlcode): #获取系列 已修改
html = etree.fromstring(htmlcode, etree.HTMLParser())
@@ -122,15 +124,11 @@ def main_uncensored(number):
htmlcode = get_html('https://www.javbus.com/ja/' + number)
if getTitle(htmlcode) == '':
htmlcode = get_html('https://www.javbus.com/ja/' + number.replace('-','_'))
try:
dww_htmlcode = fanza.main_htmlcode(getCID(htmlcode))
except:
dww_htmlcode = ''
dic = {
'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))).replace(getNum(htmlcode)+'-',''),
'studio': getStudio(htmlcode),
'year': getYear(htmlcode),
'outline': getOutline(dww_htmlcode),
'outline': getOutline(number),
'runtime': getRuntime(htmlcode),
'director': getDirector(htmlcode),
'actor': getActor(htmlcode),
@@ -157,15 +155,11 @@ def main(number):
htmlcode = get_html('https://www.fanbus.us/' + number)
except:
htmlcode = get_html('https://www.javbus.com/' + number)
try:
dww_htmlcode = fanza.main_htmlcode(getCID(htmlcode))
except:
dww_htmlcode = ''
dic = {
'title': str(re.sub('\w+-\d+-', '', getTitle(htmlcode))),
'studio': getStudio(htmlcode),
'year': str(re.search('\d{4}', getYear(htmlcode)).group()),
'outline': getOutline(dww_htmlcode),
'outline': getOutline(number),
'runtime': getRuntime(htmlcode),
'director': getDirector(htmlcode),
'actor': getActor(htmlcode),