From 50a8eecdf927299f2276f4097bdc40be012bbd28 Mon Sep 17 00:00:00 2001 From: sqzw-x Date: Sun, 29 Sep 2024 17:08:54 +0800 Subject: [PATCH] fix: fc2hub, javday url (fix#265) --- src/controllers/main_window/main_window.py | 2 +- src/models/config/config_manual.py | 1 + src/models/crawlers/fc2hub.py | 7 +++---- src/models/crawlers/javday.py | 10 ++++------ 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/controllers/main_window/main_window.py b/src/controllers/main_window/main_window.py index 09dfa34..f967db7 100644 --- a/src/controllers/main_window/main_window.py +++ b/src/controllers/main_window/main_window.py @@ -2070,7 +2070,7 @@ def network_check(self): 'yesjav': ['http://www.yesjav.info', ''], 'fc2': ['https://adult.contents.fc2.com', ''], 'fc2club': ['https://fc2club.top', ''], - 'fc2hub': ['https://fc2hub.com', ''], + 'fc2hub': ['https://javten.com', ''], 'airav': ['https://www.airav.wiki', ''], 'av-wiki': ['https://av-wiki.net', ''], 'seesaawiki': ['https://seesaawiki.jp', ''], diff --git a/src/models/config/config_manual.py b/src/models/config/config_manual.py index a3e7615..d033308 100644 --- a/src/models/config/config_manual.py +++ b/src/models/config/config_manual.py @@ -59,6 +59,7 @@ class ManualConfig: 'giga', 'iqqtv', 'jav321', + 'javday', 'javbus', 'javdb', 'javlibrary', diff --git a/src/models/crawlers/fc2hub.py b/src/models/crawlers/fc2hub.py index 7481aee..661e82c 100644 --- a/src/models/crawlers/fc2hub.py +++ b/src/models/crawlers/fc2hub.py @@ -87,19 +87,18 @@ def main(number, appoint_url='', log_info='', req_web='', language='jp'): website_name = 'fc2hub' req_web += '-> %s' % website_name real_url = appoint_url - title = '' - cover_url = '' + root_url = getattr(config, 'fc2hub_website', 'https://javten.com') + number = number.upper().replace('FC2PPV', '').replace('FC2-PPV-', '').replace('FC2-', '').replace('-', '').strip() dic = {} web_info = '\n ' log_info += ' \n 🌐 fc2hub' - debug_info = '' try: # 捕获主动抛出的异常 if not real_url: # 通过搜索获取real_url - url_search = 'https://fc2hub.com/search?kw=' + number + url_search = root_url + '/search?kw=' + number debug_info = '搜索地址: %s ' % url_search log_info += web_info + debug_info diff --git a/src/models/crawlers/javday.py b/src/models/crawlers/javday.py index 81512f7..f97cd82 100644 --- a/src/models/crawlers/javday.py +++ b/src/models/crawlers/javday.py @@ -7,7 +7,7 @@ import urllib3 from lxml import etree -from models.base.web import get_html, post_html +from models.base.web import get_html from models.config.config import config from models.crawlers.guochan import get_actor_list, get_lable_list, get_number_list @@ -192,13 +192,11 @@ def main(number, appoint_url='', log_info='', req_web='', language='zh_cn', file start_time = time.time() website_name = 'javday' req_web += '-> %s' % website_name - title = '' - cover_url = '' web_info = '\n ' log_info += ' \n 🌐 javday' debug_info = '' - javday_url = getattr(config, "javday_website", 'https://javday.tv/') + javday_url = getattr(config, "javday_website", 'https://javday.tv') real_url = appoint_url real_html_content = '' try: @@ -209,7 +207,7 @@ def main(number, appoint_url='', log_info='', req_web='', language='zh_cn', file number_list_new = list(set(total_number_list)) number_list_new.sort(key=total_number_list.index) for number in number_list_new: - testNumberUrl = 'https://javday.tv/videos/%s/' % number + testNumberUrl = javday_url + f'/videos/{number}/' debug_info = '搜索地址: %s {"wd": %s}' % (testNumberUrl, number) log_info += web_info + debug_info result, html_content = get_html(testNumberUrl) @@ -224,7 +222,7 @@ def main(number, appoint_url='', log_info='', req_web='', language='zh_cn', file debug_info = '找到网页: %s' % testNumberUrl real_url = testNumberUrl real_html_content = html_content - break + break else: raise Exception(debug_info)