refactor config proxy

This commit is contained in:
jnozsc
2020-02-16 13:20:10 -08:00
parent e0d2058fa0
commit 064d8a8349
4 changed files with 19 additions and 26 deletions

10
core.py
View File

@@ -212,15 +212,7 @@ def creatFolder(success_folder, location_rule, json_data, Config): # 创建文
# =====================资源下载部分===========================
def DownloadFileWithFilename(url, filename, path, Config, filepath, failed_folder): # path = examle:photo , video.in the Project Folder!
retry_count = 0
proxy = ''
timeout = 0
try:
proxy = Config['proxy']['proxy']
timeout = int(Config['proxy']['timeout'])
retry_count = int(Config['proxy']['retry'])
except:
print('[-]Proxy config error! Please check the config.')
proxy, timeout, retry_count = get_network_settings()
i = 0
while i < retry_count: