From b5a23fe43036f6284324d11339454a7d9c671cfa Mon Sep 17 00:00:00 2001 From: wenead99 <42309414+wenead99@users.noreply.github.com> Date: Fri, 21 Jun 2019 00:03:43 +0800 Subject: [PATCH] Beta 10.3 Update 2019.6.20 --- AV_Data_Capture.py | 18 ++++++++++++++ core.py | 28 +++------------------- fc2fans_club.py | 4 ++++ javbus.py | 59 ++++++++++++++++++++++++++-------------------- 4 files changed, 58 insertions(+), 51 deletions(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index 3e4d7b3..2584d3f 100644 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -3,6 +3,20 @@ import os import time import re import sys +from ADC_function import * +import json + +version='0.10.3' + +def UpdateCheck(): + html2 = get_html('https://raw.githubusercontent.com/wenead99/AV_Data_Capture/master/update_check.json') + html = json.loads(str(html2)) + + if not version == html['version']: + print('[*] * New update '+html['version']+' *') + print('[*] * Download *') + print('[*] '+html['download']) + print('[*]=====================================') def movie_lists(): #MP4 @@ -48,6 +62,10 @@ def rreplace(self, old, new, *max): return new.join(self.rsplit(old, count)) if __name__ =='__main__': + print('[*]===========AV Data Capture===========') + print('[*] Version '+version) + print('[*]=====================================') + UpdateCheck() os.chdir(os.getcwd()) for i in movie_lists(): #遍历电影列表 交给core处理 if '_' in i: diff --git a/core.py b/core.py index ed5e9a2..2a15c9c 100644 --- a/core.py +++ b/core.py @@ -107,32 +107,10 @@ def getNumberFromFilename(filepath): except: #添加 无需 正则表达式的规则 # ====================fc2fans_club.py=================== if 'fc2' in filename: - json_data = json.loads(fc2fans_club.main(file_number.strip('fc2_').strip('fc2-'))) + json_data = json.loads(fc2fans_club.main(file_number.strip('fc2_').strip('fc2-').strip('ppv-').strip('PPV-'))) elif 'FC2' in filename: - json_data = json.loads(fc2fans_club.main(file_number.strip('FC2_').strip('FC2-'))) - - #========================siro.py======================== - elif 'siro' in filename: - json_data = json.loads(siro.main(file_number)) - elif 'SIRO' in filename: - json_data = json.loads(siro.main(file_number)) - elif '259luxu' in filename: - json_data = json.loads(siro.main(file_number)) - elif '259LUXU' in filename: - json_data = json.loads(siro.main(file_number)) - elif '300MAAN' in filename: - json_data = json.loads(siro.main(file_number)) - elif '300maan' in filename: - json_data = json.loads(siro.main(file_number)) - elif '326SCP' in filename: - json_data = json.loads(siro.main(file_number)) - elif '326scp' in filename: - json_data = json.loads(siro.main(file_number)) - elif '326URF' in filename: - json_data = json.loads(siro.main(file_number)) - elif '326urf' in filename: - json_data = json.loads(siro.main(file_number)) - + json_data = json.loads(fc2fans_club.main(file_number.strip('FC2_').strip('FC2-').strip('ppv-').strip('PPV-'))) + #print(file_number.strip('FC2_').strip('FC2-').strip('ppv-').strip('PPV-')) #=======================javbus.py======================= else: json_data = json.loads(javbus.main(file_number)) diff --git a/fc2fans_club.py b/fc2fans_club.py index 11272e3..da8a113 100644 --- a/fc2fans_club.py +++ b/fc2fans_club.py @@ -8,6 +8,7 @@ def getTitle(htmlcode): #获取厂商 html = etree.fromstring(htmlcode,etree.HTMLParser()) result = str(html.xpath('/html/body/div[2]/div/div[1]/h3/text()')).strip(" ['']") result2 = str(re.sub('\D{2}2-\d+','',result)).replace(' ','',1) + #print(result2) return result2 def getStudio(htmlcode): #获取厂商 html = etree.fromstring(htmlcode,etree.HTMLParser()) @@ -16,6 +17,7 @@ def getStudio(htmlcode): #获取厂商 def getNum(htmlcode): #获取番号 html = etree.fromstring(htmlcode, etree.HTMLParser()) result = str(html.xpath('/html/body/div[5]/div[1]/div[2]/p[1]/span[2]/text()')).strip(" ['']") + #print(result) return result def getRelease(number): a=ADC_function.get_html('http://adult.contents.fc2.com/article_search.php?id='+str(number).lstrip("FC2-").lstrip("fc2-").lstrip("fc2_").lstrip("fc2-")+'&utm_source=aff_php&utm_medium=source_code&utm_campaign=from_aff_php') @@ -55,6 +57,8 @@ def main(number2): 'imagecut': 0, 'tag':" ", } + #print(getTitle(htmlcode)) + #print(getNum(htmlcode)) js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8') return js diff --git a/javbus.py b/javbus.py index e5e1712..bca16ec 100644 --- a/javbus.py +++ b/javbus.py @@ -10,6 +10,7 @@ from PIL import Image#need install import time import json from ADC_function import * +import siro def getTitle(htmlcode): #获取标题 doc = pq(htmlcode) @@ -70,32 +71,13 @@ def getTag(htmlcode): # 获取演员 def main(number): - htmlcode=get_html('https://www.javbus.com/'+number) - dww_htmlcode=get_html("https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=" + number.replace("-", '')) - 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), - 'runtime': getRuntime(htmlcode), - 'director': getDirector(htmlcode), - 'actor': getActor(htmlcode), - 'release': getRelease(htmlcode), - 'number': getNum(htmlcode), - 'cover': getCover(htmlcode), - 'imagecut': 1, - 'tag': getTag(htmlcode), - 'label': getSerise(htmlcode), - } - js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8') - - if 'HEYZO' in number or 'heyzo' in number or 'Heyzo' in number: + try: htmlcode = get_html('https://www.javbus.com/' + number) dww_htmlcode = get_html("https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=" + number.replace("-", '')) dic = { - 'title': str(re.sub('\w+-\d+-','',getTitle(htmlcode))), + 'title': str(re.sub('\w+-\d+-', '', getTitle(htmlcode))), 'studio': getStudio(htmlcode), - 'year': getYear(htmlcode), + 'year': str(re.search('\d{4}', getYear(htmlcode)).group()), 'outline': getOutline(dww_htmlcode), 'runtime': getRuntime(htmlcode), 'director': getDirector(htmlcode), @@ -105,12 +87,35 @@ def main(number): 'cover': getCover(htmlcode), 'imagecut': 1, 'tag': getTag(htmlcode), - 'label': getSerise(htmlcode), + 'label': getSerise(htmlcode), } - js2 = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') - return js2 + js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8') - return js + if 'HEYZO' in number or 'heyzo' in number or 'Heyzo' in number: + htmlcode = get_html('https://www.javbus.com/' + number) + dww_htmlcode = get_html("https://www.dmm.co.jp/mono/dvd/-/detail/=/cid=" + number.replace("-", '')) + dic = { + 'title': str(re.sub('\w+-\d+-', '', getTitle(htmlcode))), + 'studio': getStudio(htmlcode), + 'year': getYear(htmlcode), + 'outline': getOutline(dww_htmlcode), + 'runtime': getRuntime(htmlcode), + 'director': getDirector(htmlcode), + 'actor': getActor(htmlcode), + 'release': getRelease(htmlcode), + 'number': getNum(htmlcode), + 'cover': getCover(htmlcode), + 'imagecut': 1, + 'tag': getTag(htmlcode), + 'label': getSerise(htmlcode), + } + js2 = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, + separators=(',', ':'), ) # .encode('UTF-8') + return js2 + return js + except: + a=siro.main(number) + return a def main_uncensored(number): htmlcode = get_html('https://www.javbus.com/' + number) @@ -155,6 +160,8 @@ def main_uncensored(number): return js +#print(main('SIRO-3821')) + # def return1(): # json_data=json.loads(main('ipx-292'))