diff --git a/src/models/config/config_manual.py b/src/models/config/config_manual.py index b4cd7ba..2229330 100644 --- a/src/models/config/config_manual.py +++ b/src/models/config/config_manual.py @@ -497,7 +497,7 @@ class ManualConfig: '.chs', ] web_dic = { - 'airav.cc': 'airav_cc', + 'airav.io': 'airav_cc', 'airav.wiki': 'airav', '9sex': 'avsex', 'avsex': 'avsex', diff --git a/src/models/core/crawler.py b/src/models/core/crawler.py index aebeba1..a25b473 100644 --- a/src/models/core/crawler.py +++ b/src/models/core/crawler.py @@ -9,9 +9,9 @@ from models.base.number import get_number_letters, is_uncensored from models.config.config import config from models.core.flags import Flags -from models.crawlers import airav_cc_new, airav_new, avsex, avsox, cnmdb, dahlia, dmm, faleno, fantastica, fc2, fc2club, \ - fc2hub, freejavbt, getchu, getchu_dmm, giga, hdouban, iqqtv_new, jav321, javbus, javdb, javlibrary_new, kin8, love6, \ - lulubar, madouqu, mdtv, mgstage, mmtv, mywife, official, prestige, theporndb, xcity, hscangku, cableav +from models.crawlers import airav, airav_cc, avsex, avsox, cableav, cnmdb, dahlia, dmm, faleno, fantastica, fc2, \ + fc2club, fc2hub, freejavbt, getchu, getchu_dmm, giga, hdouban, hscangku, iqqtv_new, jav321, javbus, javdb, \ + javlibrary_new, kin8, love6, lulubar, madouqu, mdtv, mgstage, mmtv, mywife, official, prestige, theporndb, xcity from models.entity.enums import FileMode @@ -102,9 +102,9 @@ def _call_crawler(json_data, website, language, file_number, short_number, mosai elif website == 'avsex': json_data = json.loads(avsex.main(file_number, appoint_url, log_info, req_web, language)) elif website == 'airav_cc': - json_data = json.loads(airav_cc_new.main(file_number, appoint_url, log_info, req_web, language)) + json_data = json.loads(airav_cc.main(file_number, appoint_url, log_info, req_web, language)) elif website == 'airav': - json_data = json.loads(airav_new.main(file_number, appoint_url, log_info, req_web, language)) + json_data = json.loads(airav.main(file_number, appoint_url, log_info, req_web, language)) elif website == 'freejavbt': json_data = json.loads(freejavbt.main(file_number, appoint_url, log_info, req_web, language)) elif website == 'javbus': @@ -142,7 +142,7 @@ def _call_crawler(json_data, website, language, file_number, short_number, mosai hscangku.main(file_number, appoint_url, log_info, req_web, language, file_path, appoint_number)) elif website == 'cableav': json_data = json.loads( - cableav.main(file_number, appoint_url, log_info, req_web, language, file_path, appoint_number)) + cableav.main(file_number, appoint_url, log_info, req_web, language, file_path, appoint_number)) elif website == 'getchu': json_data = json.loads(getchu.main(file_number, appoint_url, log_info, req_web, language)) elif website == 'getchu_dmm': diff --git a/src/models/crawlers/airav_cc.py b/src/models/crawlers/airav_cc.py index f173771..f6cd602 100644 --- a/src/models/crawlers/airav_cc.py +++ b/src/models/crawlers/airav_cc.py @@ -113,7 +113,7 @@ def retry_request(real_url, log_info, web_info): def main(number, appoint_url='', log_info='', req_web='', language='zh_cn'): start_time = time.time() website_name = 'airav_cc' - req_web += '-> %s[%s]' % (website_name, language) + req_web += f'-> {website_name}[{language}]' number = number.upper() if re.match(r'N\d{4}', number): # n1403 number = number.lower() @@ -123,11 +123,11 @@ def main(number, appoint_url='', log_info='', req_web='', language='zh_cn'): image_download = False url_search = '' mosaic = 'ๆœ‰็ ' - airav_url = getattr(config, 'airav_cc_website', 'https://airav5.fun') + airav_url = getattr(config, 'airav_cc_website', 'https://airav.io') if language == 'zh_cn': airav_url += '/cn' web_info = '\n ' - log_info += ' \n ๐ŸŒ airav[%s]' % language.replace('zh_', '') + log_info += f' \n ๐ŸŒ airav[{language.replace("zh_", "")}]' debug_info = '' # real_url = 'https://airav5.fun/jp/playon.aspx?hid=44733' @@ -258,9 +258,9 @@ def main(number, appoint_url='', log_info='', req_web='', language='zh_cn'): if __name__ == '__main__': # yapf: disable - # print(main('', 'https://airav5.fun/playon.aspx?hid=99-21-46640')) + print(main('', 'https://airav.io/playon.aspx?hid=99-21-46640')) # print(main('PRED-300')) # ้ฉฌ่ต›ๅ…‹็ ดๅ็‰ˆ - print(main('snis-036', language='jp')) + # print(main('snis-036', language='jp')) # print(main('snis-036')) # print(main('MIAE-346')) # print(main('STARS-1919')) # posterๅ›พ็‰‡ diff --git a/src/models/crawlers/airav_cc_new.py b/src/models/crawlers/airav_cc_new.py deleted file mode 100644 index f778b59..0000000 --- a/src/models/crawlers/airav_cc_new.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -import json - -from models.config.config import config -from models.crawlers import airav_cc - - -def main(number, appoint_url='', log_info='', req_web='', language='zh_cn'): - all_language = config.title_language + config.outline_language + config.actor_language + \ - config.tag_language + config.series_language + config.studio_language - if 'airav.cc/cn/' in appoint_url: - appoint_url = appoint_url.replace('airav.cc/cn/', 'airav.cc/jp/') - elif 'airav.cc/playon.aspx' in appoint_url: - appoint_url = appoint_url.replace('airav.cc/playon.aspx', 'airav.cc/jp/playon.aspx') - json_data = json.loads(airav_cc.main(number, appoint_url, log_info, req_web, 'jp')) - if not json_data['airav_cc']['jp']['title']: - json_data['airav_cc']['zh_cn'] = json_data['airav_cc']['jp'] - json_data['airav_cc']['zh_tw'] = json_data['airav_cc']['jp'] - return json.dumps( - json_data, - ensure_ascii=False, - sort_keys=False, - indent=4, - separators=(',', ': '), - ) - - log_info = json_data['airav_cc']['jp']['log_info'] - req_web = json_data['airav_cc']['jp']['req_web'] - - if 'zh_cn' in all_language: - language = 'zh_cn' - appoint_url = json_data['airav_cc']['jp']['website'].replace('airav.cc/jp/', 'airav.cc/cn/') - elif 'zh_tw' in all_language: - language = 'zh_tw' - appoint_url = json_data['airav_cc']['jp']['website'].replace('airav.cc/jp/', 'airav.cc/') - - json_data_zh = json.loads(airav_cc.main(number, appoint_url, log_info, req_web, language)) - dic = json_data_zh['airav_cc'][language] - dic['originaltitle'] = json_data['airav_cc']['jp']['originaltitle'] - dic['originalplot'] = json_data['airav_cc']['jp']['originalplot'] - json_data['airav_cc'].update({'zh_cn': dic, 'zh_tw': dic}) - - js = json.dumps( - json_data, - ensure_ascii=False, - sort_keys=False, - indent=4, - separators=(',', ': '), - ) # .encode('UTF-8') - return js - - -if __name__ == '__main__': - print(main('', 'https://airav.cc/playon.aspx?hid=99-21-46640')) - # print(main('ISRD-006')) - # print(main('abs-141')) - # print(main('HYSD-00083')) - # print(main('IESP-660')) - # print(main('n1403')) - # print(main('GANA-1910')) - # print(main('heyzo-1031')) - # print(main_us('x-art.19.11.03')) - # print(main('032020-001')) - # print(main('S2M-055')) - # print(main('LUXU-1217')) - - # print(main('1101132', '')) - # print(main('OFJE-318')) - # print(main('110119-001')) - # print(main('abs-001')) - # print(main('SSIS-090', '')) - # print(main('SSIS-090', '')) - # print(main('SNIS-016', '')) - # print(main('HYSD-00083', '')) - # print(main('IESP-660', '')) - # print(main('n1403', '')) - # print(main('GANA-1910', '')) - # print(main('heyzo-1031', '')) - # print(main_us('x-art.19.11.03')) - # print(main('032020-001', '')) - # print(main('S2M-055', '')) - # print(main('LUXU-1217', '')) - # print(main_us('x-art.19.11.03', '')) diff --git a/src/models/crawlers/airav_new.py b/src/models/crawlers/airav_new.py deleted file mode 100644 index 78425ae..0000000 --- a/src/models/crawlers/airav_new.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -import json - -from models.config.config import config -from models.crawlers import airav - - -def main(number, appoint_url='', log_info='', req_web='', language='zh_cn'): - all_language = config.title_language + config.outline_language + config.actor_language + \ - config.tag_language + config.series_language + config.studio_language - if 'cn.airav.wiki' in appoint_url: - appoint_url = appoint_url.replace('cn.airav.wiki', 'jp.airav.wiki') - elif 'www.airav.wiki' in appoint_url: - appoint_url = appoint_url.replace('www.airav.wiki', 'jp.airav.wiki') - elif 'jp.airav.wiki' in appoint_url: - appoint_url = appoint_url - json_data = json.loads(airav.main(number, appoint_url, log_info, req_web, 'jp')) - if not json_data['airav']['jp']['title']: - json_data['airav']['zh_cn'] = json_data['airav']['jp'] - json_data['airav']['zh_tw'] = json_data['airav']['jp'] - return json.dumps( - json_data, - ensure_ascii=False, - sort_keys=False, - indent=4, - separators=(',', ': '), - ) - - log_info = json_data['airav']['jp']['log_info'] - req_web = json_data['airav']['jp']['req_web'] - - if 'zh_cn' in all_language: - language = 'zh_cn' - appoint_url = json_data['airav']['jp']['website'].replace('jp.airav.wiki', 'cn.airav.wiki') - - elif 'zh_tw' in all_language: - language = 'zh_tw' - appoint_url = json_data['airav']['jp']['website'].replace('jp.airav.wiki', 'www.airav.wiki') - - json_data_zh = json.loads(airav.main(number, appoint_url, log_info, req_web, language)) - dic = json_data_zh['airav'][language] - dic['originaltitle'] = json_data['airav']['jp']['originaltitle'] - dic['originalplot'] = json_data['airav']['jp']['originalplot'] - json_data['airav'].update({'zh_cn': dic, 'zh_tw': dic}) - - js = json.dumps( - json_data, - ensure_ascii=False, - sort_keys=False, - indent=4, - separators=(',', ': '), - ) # .encode('UTF-8') - return js - - -if __name__ == '__main__': - # print(main('', 'https://cn.airav.wiki/video/DOCP-324')) - # print(main('ALDN-107')) - # print(main('APNS-259', language='zh_cn')) - print(main('ISRD-006')) - # print(main('abs-141')) - # print(main('HYSD-00083')) - # print(main('IESP-660')) - # print(main('n1403')) - # print(main('GANA-1910')) - # print(main('heyzo-1031')) - # print(main_us('x-art.19.11.03')) - # print(main('032020-001')) - # print(main('S2M-055')) - # print(main('LUXU-1217')) - # print(main('1101132', '')) - # print(main('OFJE-318')) - # print(main('110119-001')) - # print(main('abs-001')) - # print(main('SSIS-090', '')) - # print(main('SSIS-090', '')) - # print(main('SNIS-016', '')) - # print(main('HYSD-00083', '')) - # print(main('IESP-660', '')) - # print(main('n1403', '')) - # print(main('GANA-1910', '')) - # print(main('heyzo-1031', '')) - # print(main_us('x-art.19.11.03')) - # print(main('032020-001', '')) - # print(main('S2M-055', '')) - # print(main('LUXU-1217', '')) - # print(main_us('x-art.19.11.03', ''))