You've already forked XiguaLiveDanmakuHelper
避免下播马上上播它还是把稿投出去的问题(未测试)
This commit is contained in:
@ -299,7 +299,7 @@ def appendError(obj):
|
|||||||
def loginBilibili(force=False):
|
def loginBilibili(force=False):
|
||||||
if config["dlO"] is False or forceNotUpload is False:
|
if config["dlO"] is False or forceNotUpload is False:
|
||||||
global loginTime
|
global loginTime
|
||||||
if not force and getTimeDelta(datetime.now(), loginTime) < 86400 * 3:
|
if not force or getTimeDelta(datetime.now(), loginTime) < 86400 * 5:
|
||||||
return False
|
return False
|
||||||
res = b.login(config["b_u"], config["b_p"])
|
res = b.login(config["b_u"], config["b_p"])
|
||||||
loginTime = datetime.now()
|
loginTime = datetime.now()
|
||||||
@ -326,6 +326,7 @@ class downloader(XiGuaLiveApi):
|
|||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.updPlayList()
|
self.updPlayList()
|
||||||
else:
|
else:
|
||||||
|
resetDelay()
|
||||||
self.playlist = False
|
self.playlist = False
|
||||||
|
|
||||||
def updPlayList(self):
|
def updPlayList(self):
|
||||||
@ -381,9 +382,9 @@ def uploadVideo(name):
|
|||||||
global isUpload
|
global isUpload
|
||||||
if not os.path.exists(name):
|
if not os.path.exists(name):
|
||||||
Common.appendError("Upload File Not Exist {}".format(name))
|
Common.appendError("Upload File Not Exist {}".format(name))
|
||||||
|
isUpload = True
|
||||||
loginBilibili()
|
loginBilibili()
|
||||||
doClean()
|
doClean()
|
||||||
isUpload = True
|
|
||||||
if forceNotUpload is False:
|
if forceNotUpload is False:
|
||||||
b.preUpload(VideoPart(name, os.path.basename(name)))
|
b.preUpload(VideoPart(name, os.path.basename(name)))
|
||||||
else:
|
else:
|
||||||
@ -414,9 +415,9 @@ def encodeVideo(name):
|
|||||||
if os.path.getsize(name) < 8 * 1024 * 1024:
|
if os.path.getsize(name) < 8 * 1024 * 1024:
|
||||||
appendEncodeStatus("Encoded File >{}< is too small, will ignore it".format(name))
|
appendEncodeStatus("Encoded File >{}< is too small, will ignore it".format(name))
|
||||||
return False
|
return False
|
||||||
appendEncodeStatus("Encoding >{}< Start".format(name))
|
|
||||||
global isEncode
|
global isEncode
|
||||||
isEncode=True
|
isEncode=True
|
||||||
|
appendEncodeStatus("Encoding >{}< Start".format(name))
|
||||||
_new_name = os.path.splitext(name)[0]+".mp4"
|
_new_name = os.path.splitext(name)[0]+".mp4"
|
||||||
_code = os.system(config["enc"].format(f=name, t=_new_name))
|
_code = os.system(config["enc"].format(f=name, t=_new_name))
|
||||||
if _code != 0:
|
if _code != 0:
|
||||||
|
Reference in New Issue
Block a user