diff --git a/synchronize/synchronize.py b/synchronize/synchronize.py index 9e2258d..7f6940d 100644 --- a/synchronize/synchronize.py +++ b/synchronize/synchronize.py @@ -71,6 +71,12 @@ def sychronize(url, filepath): log('[ERROR]:There has a error in task of synchronizing the file ' + SavePath + filepath + '.') else: log('[INFO]:The file ' + SavePath + filepath + ' has been synchronized successfully.') +#Function Which Be Used To Get HTTP Site With Requests Avoid Error. +def httpget(url): + try: + return requests.get(url=url, headers=UserAgent).text + except: + return 'error' log('[INFO]:Loading all kinds of functions successfully.') #------------------------------------------------------------------------#