部分改进:下载文件大小为0时,删除文件并不上传该文件

This commit is contained in:
Jerry Yan 2019-03-18 09:17:51 +08:00
parent 9316b1e855
commit 9a74b2b6e5

View File

@ -11,7 +11,7 @@ q = queue.Queue()
base_uri = ""
isUpload = False
uq = queue.Queue()
eq = queue.Queue()
class downloader(XiGuaLiveApi):
files = []
@ -89,6 +89,9 @@ def download(url):
print("{} : Download Quiting With Exception {}".format(datetime.strftime(datetime.now(), "%y%m%d %H%M"),e.__str__()))
f.close()
isUpload = True
if os.path.getsize(path) == 0:
os.remove(path)
return False
uq.put(path)
download(url)