Change error output in Debug mode

This commit is contained in:
yoshiko2
2023-05-07 22:11:52 +08:00
parent 0fe08d0173
commit 961b9544d0

View File

@@ -90,9 +90,8 @@ class Scraping:
continue continue
json_data = json.loads(data) json_data = json.loads(data)
except Exception as e: except Exception as e:
print('[!] 出错啦') if config.getInstance().debug():
print(e) print(e)
pass
# if any service return a valid return, break # if any service return a valid return, break
if self.get_data_state(json_data): if self.get_data_state(json_data):
if self.debug: if self.debug:
@@ -102,8 +101,7 @@ class Scraping:
continue continue
# Return if data not found in all sources # Return if data not found in all sources
if not json_data: if not json_data or json_data['title'] == "":
print(f'[-]Movie Number [{name}] not found!')
return None return None
# If actor is anonymous, Fill in Anonymous # If actor is anonymous, Fill in Anonymous
@@ -137,9 +135,8 @@ class Scraping:
continue continue
json_data = json.loads(data) json_data = json.loads(data)
except Exception as e: except Exception as e:
print('[!] 出错啦') if config.getInstance().debug():
print(e) print(e)
pass
# json_data = self.func_mapping[source](number, self) # json_data = self.func_mapping[source](number, self)
# if any service return a valid return, break # if any service return a valid return, break
if self.get_data_state(json_data): if self.get_data_state(json_data):
@@ -171,8 +168,7 @@ class Scraping:
pass pass
# Return if data not found in all sources # Return if data not found in all sources
if not json_data: if not json_data or json_data['title'] == "":
print(f'[-]Movie Number [{number}] not found!')
return None return None
# If actor is anonymous, Fill in Anonymous # If actor is anonymous, Fill in Anonymous