Fix: Actions when upload finished will not work fixed

This commit is contained in:
Jerry Yan 2019-02-02 19:21:26 +08:00
parent 530522f51c
commit 0219d5d1aa
2 changed files with 4 additions and 1 deletions

View File

@ -323,6 +323,8 @@ class Bilibili:
"videos": self.videos} "videos": self.videos}
) )
print(r.text) print(r.text)
def clear(self):
self.files.clear() self.files.clear()
self.videos.clear() self.videos.clear()

View File

@ -148,10 +148,11 @@ def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")):
elif config["del"]: elif config["del"]:
for _p in b.files: for _p in b.files:
os.remove(_p.path) os.remove(_p.path)
b.clear()
break break
print("{} : Upload {}".format(datetime.strftime(datetime.now(), "%y%m%d %H%M"), i)) print("{} : Upload {}".format(datetime.strftime(datetime.now(), "%y%m%d %H%M"), i))
try: try:
b.preUpload(VideoPart(i, i)) b.preUpload(VideoPart(i, os.path.basename(i)))
except: except:
continue continue
i = uq.get() i = uq.get()