diff --git a/ADC_function.py b/ADC_function.py index e43fe5f..5b1d507 100755 --- a/ADC_function.py +++ b/ADC_function.py @@ -1,6 +1,6 @@ from os import replace import requests -import hashlib +#import hashlib from pathlib import Path import secrets import os.path @@ -20,7 +20,7 @@ def getXpathSingle(htmlcode, xpath): return result1 -G_USER_AGENT = r'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36' +G_USER_AGENT = r'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36' # 网页请求核心 def get_html(url, cookies: dict = None, ua: str = None, return_type: str = None): diff --git a/WebCrawler/__init__.py b/WebCrawler/__init__.py index c5d02b5..b6e7b2f 100644 --- a/WebCrawler/__init__.py +++ b/WebCrawler/__init__.py @@ -115,6 +115,7 @@ def get_data_from_json(file_number): # 从JSON返回元数据 json_data = json.loads(pool.apply_async(func_mapping[source], (file_number,)).get()) # if any service return a valid return, break if get_data_state(json_data): + print(f"[+]Find movie [{file_number}] metadata on website '{source}'") break pool.close() pool.terminate() @@ -126,6 +127,7 @@ def get_data_from_json(file_number): # 从JSON返回元数据 json_data = json.loads(func_mapping[source](file_number)) # if any service return a valid return, break if get_data_state(json_data): + print(f"[+]Find movie [{file_number}] metadata on website '{source}'") break except: break diff --git a/WebCrawler/storyline.py b/WebCrawler/storyline.py index b32778d..5ad4fd7 100644 --- a/WebCrawler/storyline.py +++ b/WebCrawler/storyline.py @@ -34,7 +34,7 @@ def getStoryline(number, title): for i in range(cnt): sl = len(result[i])if isinstance(result[i], str) else 0 if sl and first: - s += f',[选中结果{apply_sites[i]}字数:{sl}]' + s += f',[选中{apply_sites[i]}字数:{sl}]' first = False sel = result[i] elif sl: diff --git a/config.py b/config.py index 5624e85..abe030e 100644 --- a/config.py +++ b/config.py @@ -394,10 +394,10 @@ if __name__ == "__main__": code = compile(evstr, "", "eval") print('{}: "{}"'.format(evstr, eval(code))) config = Config() - mfilter = ('conf', 'proxy', '_exit', '_default_config', 'getboolean_override', 'getint_override', 'get_override', 'ini_path') + mfilter = {'conf', 'proxy', '_exit', '_default_config', 'getboolean_override', 'getint_override', 'get_override', 'ini_path'} for _m in [m for m in dir(config) if not m.startswith('__') and m not in mfilter]: evprint(f'config.{_m}()') - pfilter = ('proxies', 'SUPPORT_PROXY_TYPE') + pfilter = {'proxies', 'SUPPORT_PROXY_TYPE'} # test getInstance() assert(getInstance() == config) for _p in [p for p in dir(getInstance().proxy()) if not p.startswith('__') and p not in pfilter]: