新增模块httpget
This commit is contained in:
parent
558a662b21
commit
76c54149d2
@ -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.')
|
||||
|
||||
#------------------------------------------------------------------------#
|
||||
|
Reference in New Issue
Block a user