diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index 0cb1c0f..d23d49b 100644 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -71,8 +71,8 @@ if __name__ =='__main__': if '_' in i: os.rename(re.search(r'[^\\/:*?"<>|\r\n]+$', i).group(), rreplace(re.search(r'[^\\/:*?"<>|\r\n]+$', i).group(), '_', '-', 1)) i = rreplace(re.search(r'[^\\/:*?"<>|\r\n]+$', i).group(), '_', '-', 1) - os.system('python core.py' + ' "' + i + '"') #选择从py文件启动 (用于源码py) - #os.system('core.exe' + ' "' + i + '"') #选择从exe文件启动(用于EXE版程序) + #os.system('python core.py' + ' "' + i + '"') #选择从py文件启动 (用于源码py) + os.system('core.exe' + ' "' + i + '"') #选择从exe文件启动(用于EXE版程序) print("[*]=====================================") print("[!]Cleaning empty folders") diff --git a/fc2fans_club.py b/fc2fans_club.py index da8a113..39c0647 100644 --- a/fc2fans_club.py +++ b/fc2fans_club.py @@ -10,6 +10,14 @@ def getTitle(htmlcode): #获取厂商 result2 = str(re.sub('\D{2}2-\d+','',result)).replace(' ','',1) #print(result2) return result2 +def getActor(htmlcode): + try: + html = etree.fromstring(htmlcode, etree.HTMLParser()) + result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[5]/a/text()')).strip(" ['']") + return result + except: + return '' + def getStudio(htmlcode): #获取厂商 html = etree.fromstring(htmlcode,etree.HTMLParser()) result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[3]/a[1]/text()')).strip(" ['']") @@ -19,47 +27,58 @@ def getNum(htmlcode): #获取番号 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') - html=etree.fromstring(a,etree.HTMLParser()) +def getRelease(htmlcode2): # + #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') + html=etree.fromstring(htmlcode2,etree.HTMLParser()) result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[1]/div/div[2]/dl/dd[4]/text()')).strip(" ['']") return result -def getCover(htmlcode,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') - html = etree.fromstring(a, etree.HTMLParser()) +def getCover(htmlcode,number,htmlcode2): #获取厂商 # + #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') + html = etree.fromstring(htmlcode2, etree.HTMLParser()) result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[1]/div/div[1]/a/img/@src')).strip(" ['']") - return 'http:'+result -def getOutline(htmlcode,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') - html = etree.fromstring(a, etree.HTMLParser()) + if result == '': + html = etree.fromstring(htmlcode, etree.HTMLParser()) + result2 = str(html.xpath('//*[@id="slider"]/ul[1]/li[1]/img/@src')).strip(" ['']") + return 'http://fc2fans.club' + result2 + return 'http:' + result + +def getOutline(htmlcode2,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') + html = etree.fromstring(htmlcode2, etree.HTMLParser()) result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[4]/p/text()')).replace("\\n",'',10000).strip(" ['']").replace("'",'',10000) return result -# def getTag(htmlcode,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') -# html = etree.fromstring(a, etree.HTMLParser()) -# result = str(html.xpath('//*[@id="container"]/div[1]/div/article/section[4]/p/text()')).replace("\\n",'',10000).strip(" ['']").replace("'",'',10000) -# return result +def getTag(htmlcode): #获取番号 + html = etree.fromstring(htmlcode, etree.HTMLParser()) + result = str(html.xpath('/html/body/div[2]/div/div[1]/h5[4]/a/text()')) + return result.strip(" ['']").replace("'",'').replace(' ','') +def getYear(release): + try: + result = re.search('\d{4}',release).group() + return result + except: + return '' def main(number2): number=number2.replace('PPV','').replace('ppv','') + htmlcode2 = 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') htmlcode = ADC_function.get_html('http://fc2fans.club/html/FC2-' + number + '.html') dic = { 'title': getTitle(htmlcode), 'studio': getStudio(htmlcode), - 'year': str(re.search('\d{4}',getRelease(number)).group()), + 'year': '',#str(re.search('\d{4}',getRelease(number)).group()), 'outline': getOutline(htmlcode,number), - 'runtime': '', + 'runtime': getYear(getRelease(htmlcode)), 'director': getStudio(htmlcode), - 'actor': '', + 'actor': getActor(htmlcode), 'release': getRelease(number), 'number': 'FC2-'+number, - 'cover': getCover(htmlcode,number), + 'cover': getCover(htmlcode,number,htmlcode2), 'imagecut': 0, - 'tag':" ", + 'tag':getTag(htmlcode), } #print(getTitle(htmlcode)) #print(getNum(htmlcode)) js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8') return js -#print(main('1104989')) \ No newline at end of file +#print(main('1051725')) \ No newline at end of file diff --git a/javbus.py b/javbus.py index 4054e81..d452717 100644 --- a/javbus.py +++ b/javbus.py @@ -164,8 +164,6 @@ def main_uncensored(number): return js -#print(main('SIRO-3821')) - # def return1(): # json_data=json.loads(main('ipx-292')) diff --git a/proxy.ini b/proxy.ini index 781963d..03c07be 100644 --- a/proxy.ini +++ b/proxy.ini @@ -3,4 +3,4 @@ proxy=127.0.0.1:1080 [Name_Rule] location_rule='JAV_output/'+actor+'/'+'['+number+']-'+title -naming_rule=number \ No newline at end of file +naming_rule=number+'-'+title \ No newline at end of file