Skip to content

Commit

Permalink
fix: fc2hub, javday url (fix#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqzw-x committed Sep 29, 2024
1 parent e5c0df9 commit 50a8eec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/controllers/main_window/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', ''],
Expand Down
1 change: 1 addition & 0 deletions src/models/config/config_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class ManualConfig:
'giga',
'iqqtv',
'jav321',
'javday',
'javbus',
'javdb',
'javlibrary',
Expand Down
7 changes: 3 additions & 4 deletions src/models/crawlers/fc2hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions src/models/crawlers/javday.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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)

Expand Down

0 comments on commit 50a8eec

Please sign in to comment.