From 70f1b16b3c765ba14c37d48fbb6aac3e5c8d97bc Mon Sep 17 00:00:00 2001 From: Yoshiko <42309414+yoshiko2@users.noreply.github.com> Date: Wed, 22 Jan 2020 02:19:40 +0800 Subject: [PATCH] Update 2.2 --- AV_Data_Capture.py | 2 +- config.ini | 2 +- javdb.py | 17 +++++++++-------- update_check.json | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index 36088e0..82adf91 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -14,7 +14,7 @@ os.chdir(os.getcwd()) # ============global var=========== -version='2.1' +version='2.2' config = ConfigParser() config.read(config_file, encoding='UTF-8') diff --git a/config.ini b/config.ini index 6a735e8..75ddbf2 100644 --- a/config.ini +++ b/config.ini @@ -5,7 +5,7 @@ success_output_folder=JAV_output soft_link=0 [proxy] -proxy= +proxy=127.0.0.1:1081 timeout=10 retry=3 diff --git a/javdb.py b/javdb.py index a85980c..9bc67fd 100755 --- a/javdb.py +++ b/javdb.py @@ -3,6 +3,9 @@ from lxml import etree import json from bs4 import BeautifulSoup from ADC_function import * +# import sys +# import io +# sys.stdout = io.TextIOWrapper(sys.stdout.buffer, errors = 'replace', line_buffering = True) def getTitle(a): try: @@ -61,15 +64,13 @@ def getTag(a): return str(result1 + result2).strip('+').replace(",\\xa0", "").replace("'", "").replace(' ', '').replace(',,', '').lstrip(',') def getCover_small(a): html = etree.fromstring(a, etree.HTMLParser()) # //table/tr[1]/td[1]/text() - result = 'http:' + html.xpath( - '//div[@id=\'videos\']/div[@class=\'grid columns\']/div[@class=\'grid-item column\'][1]/a[' - '@class=\'box\']/div[@class=\'item-image fix-scale-cover\']/img/@src')[0] + result = html.xpath("//div[@class='item-image fix-scale-cover']/img/@src")[0] + if not 'https' in result: + result = 'https:' + result return result def getCover(htmlcode): html = etree.fromstring(htmlcode, etree.HTMLParser()) - result = str(html.xpath('/html/body/section/div/div[2]/div[1]/a/img/@src')).strip(" ['']") - if result == '': - result = str(html.xpath('/html/body/section/div/div[4]/div[1]/a/img/@src')).strip(" ['']") + result = str(html.xpath("//div[@class='column column-video-cover']/a/img/@src")).strip(" ['']") return result def getDirector(a): html = etree.fromstring(a, etree.HTMLParser()) # //table/tr[1]/td[1]/text() @@ -138,7 +139,7 @@ def main(number): 'label': getLabel(b), 'year': getYear(getRelease(b)), # str(re.search('\d{4}',getRelease(a)).group()), 'actor_photo': getActorPhoto(getActor(b)), - 'website': 'https://javdb.com' + result1, + 'website': 'https://javdb3.com' + result1, 'source': 'javdb.py', } if getNum(b) != number: # 与搜索到的番号不匹配 @@ -149,4 +150,4 @@ def main(number): # main('DV-1562') # input("[+][+]Press enter key exit, you can check the error messge before you exit.\n[+][+]按回车键结束,你可以在结束之前查看和错误信息。") -# print(get_html('https://javdb1.com/v/WwZ0Q')) +# print(main('YMDD-178')) diff --git a/update_check.json b/update_check.json index 08acd50..1763776 100644 --- a/update_check.json +++ b/update_check.json @@ -1,5 +1,5 @@ { - "version": "2.1", - "version_show":"2.1", + "version": "2.2", + "version_show":"2.2", "download": "https://github.com/yoshiko2/AV_Data_Capture/releases" }