Changed to include numbers in valid data determinate
This commit is contained in:
@@ -77,11 +77,15 @@ def get_network_settings():
|
|||||||
raise ValueError("[-]Proxy config error! Please check the config.")
|
raise ValueError("[-]Proxy config error! Please check the config.")
|
||||||
return proxy, timeout, retry_count
|
return proxy, timeout, retry_count
|
||||||
|
|
||||||
def getDataState(json_data): # 元数据获取失败检测
|
|
||||||
if json_data['title'] == '' or json_data['title'] == 'None' or json_data['title'] == 'null':
|
def get_data_state(data: dict) -> bool: # 元数据获取失败检测
|
||||||
return 0
|
if data["title"] is None or data["title"] == "" or data["title"] == "null":
|
||||||
else:
|
return False
|
||||||
return 1
|
|
||||||
|
if data["number"] is None or data["number"] == "" or data["number"] == "null":
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
def ReadMediaWarehouse():
|
def ReadMediaWarehouse():
|
||||||
return config['media']['media_warehouse']
|
return config['media']['media_warehouse']
|
||||||
|
|||||||
2
core.py
2
core.py
@@ -81,7 +81,7 @@ def getDataFromJSON(file_number, filepath, failed_folder): # 从JSON返回元
|
|||||||
for source in sources:
|
for source in sources:
|
||||||
json_data = json.loads(func_mapping[source](file_number))
|
json_data = json.loads(func_mapping[source](file_number))
|
||||||
# if any service return a valid return, break
|
# if any service return a valid return, break
|
||||||
if getDataState(json_data) != 0:
|
if get_data_state(json_data):
|
||||||
break
|
break
|
||||||
|
|
||||||
# ================================================网站规则添加结束================================================
|
# ================================================网站规则添加结束================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user