避免下播马上上播它还是把稿投出去的问题(未测试)

This commit is contained in:
Jerry Yan 2019-12-09 09:35:17 +08:00
parent 8520a36be2
commit e3fa5d9de0

View File

@ -299,7 +299,7 @@ def appendError(obj):
def loginBilibili(force=False):
if config["dlO"] is False or forceNotUpload is False:
global loginTime
if not force and getTimeDelta(datetime.now(), loginTime) < 86400 * 3:
if not force or getTimeDelta(datetime.now(), loginTime) < 86400 * 5:
return False
res = b.login(config["b_u"], config["b_p"])
loginTime = datetime.now()
@ -326,6 +326,7 @@ class downloader(XiGuaLiveApi):
if self.isLive:
self.updPlayList()
else:
resetDelay()
self.playlist = False
def updPlayList(self):
@ -381,9 +382,9 @@ def uploadVideo(name):
global isUpload
if not os.path.exists(name):
Common.appendError("Upload File Not Exist {}".format(name))
isUpload = True
loginBilibili()
doClean()
isUpload = True
if forceNotUpload is False:
b.preUpload(VideoPart(name, os.path.basename(name)))
else:
@ -414,9 +415,9 @@ def encodeVideo(name):
if os.path.getsize(name) < 8 * 1024 * 1024:
appendEncodeStatus("Encoded File >{}< is too small, will ignore it".format(name))
return False
appendEncodeStatus("Encoding >{}< Start".format(name))
global isEncode
isEncode=True
appendEncodeStatus("Encoding >{}< Start".format(name))
_new_name = os.path.splitext(name)[0]+".mp4"
_code = os.system(config["enc"].format(f=name, t=_new_name))
if _code != 0: