diff --git a/synchronize/synchronize.py b/synchronize/synchronize.py index 1ce3c58..d8bb2a9 100644 --- a/synchronize/synchronize.py +++ b/synchronize/synchronize.py @@ -14,6 +14,10 @@ SystemName='GeMC API Synchronize Tool' SavePath='gemcapi/' Version='2.3.0' UserAgent={'User-Agent':'GeMCAPI/2.3.0 (GeMC Sync Release 2.3.0;Release)'} +Proxies = { + "http": "http://127.0.0.1:10809", #HTTP Proxies Setting + #"https": "", #HTTPS Proxies Setting +} Log='[' + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ']' + '[INFO]:Starting the synchronizing system.\n' + '------------------------------------------------------------------------\n' + '[' + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ']' + '[INFO]:Starting to specify global variables.\n' + '[' + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ']' + '[INFO]:Specifying global variables successful.\n' print('[' + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ']' + '[INFO]:Specifying global variables successful.') @@ -36,7 +40,8 @@ def synchronize(url, filepath): global UserAgent log('[INFO]:The ' + SystemName + ' is synchronizing the file ' + SavePath + filepath + '.') try: - synchronize=requests.get(url, headers=UserAgent) + #synchronize=requests.get(url, headers=UserAgent)#Without Proxies + synchronize=requests.get(url, headers=UserAgent,proxies=Proxies) with open(SavePath + filepath,"wb") as code: code.write(synchronize.content) except: