部分改进:录播工具提示
This commit is contained in:
parent
4c9d04f175
commit
426f4d6273
@ -74,21 +74,22 @@ def download(url):
|
|||||||
p = requests.get(url, stream=True)
|
p = requests.get(url, stream=True)
|
||||||
if p.status_code != 200:
|
if p.status_code != 200:
|
||||||
isUpload = True
|
isUpload = True
|
||||||
|
print("{} : Download Response 404 ,will stop looping".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
||||||
return True
|
return True
|
||||||
|
print("{} : Download {}".format(datetime.strftime(datetime.now(), "%y%m%d %H%M"), path))
|
||||||
f = open(path, "ab")
|
f = open(path, "ab")
|
||||||
try:
|
try:
|
||||||
print("{} : Download {}".format(datetime.strftime(datetime.now(), "%y%m%d %H%M"), path))
|
|
||||||
for t in p.iter_content(chunk_size=64*1024):
|
for t in p.iter_content(chunk_size=64*1024):
|
||||||
if t:
|
if t:
|
||||||
f.write(t)
|
f.write(t)
|
||||||
if os.path.getsize(path) > 1024*1024*1024*1.5:
|
if os.path.getsize(path) > 1024*1024*1024*1.5:
|
||||||
break
|
break
|
||||||
except:
|
print("{} : Download Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
||||||
pass
|
except Exception as e:
|
||||||
|
print("{} : Download Quiting With Exception {}".format(datetime.strftime(datetime.now(), "%y%m%d %H%M"),e.__str__()))
|
||||||
f.close()
|
f.close()
|
||||||
isUpload = True
|
isUpload = True
|
||||||
uq.put(path)
|
uq.put(path)
|
||||||
print("{} : Download Daemon Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
|
||||||
download(url)
|
download(url)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user