liveDownloader updPlaylist when finished downloading a part
This commit is contained in:
parent
767b4728b5
commit
bfbbe06cd2
@ -91,6 +91,7 @@ class downloader(XiGuaLiveApi):
|
|||||||
if len(self.files) > 800:
|
if len(self.files) > 800:
|
||||||
q.put(True)
|
q.put(True)
|
||||||
self.files.clear()
|
self.files.clear()
|
||||||
|
self.updRoomInfo()
|
||||||
|
|
||||||
|
|
||||||
def download(path=datetime.strftime(datetime.now(), "%Y%m%d_%H%M.ts")):
|
def download(path=datetime.strftime(datetime.now(), "%Y%m%d_%H%M.ts")):
|
||||||
@ -137,13 +138,13 @@ def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")):
|
|||||||
b.preUpload(VideoPart(i, os.path.basename(i)))
|
b.preUpload(VideoPart(i, os.path.basename(i)))
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if config["mv"]:
|
if config["mv"]:
|
||||||
shutil.move(i, config["mtd"])
|
shutil.move(i, config["mtd"])
|
||||||
elif config["del"]:
|
elif config["del"]:
|
||||||
os.remove(i)
|
os.remove(i)
|
||||||
i = uq.get()
|
i = uq.get()
|
||||||
|
|
||||||
print("{} : Upload Daemon Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
print("{} : Upload Daemon Quiting".format(datetime.strftime(datetime.now(), "%y%m%d %H%M")))
|
||||||
|
|
||||||
|
|
||||||
@ -163,7 +164,7 @@ if __name__ == "__main__":
|
|||||||
_preT = datetime.strftime(datetime.now(), "%Y%m%d_%H%M.ts")
|
_preT = datetime.strftime(datetime.now(), "%Y%m%d_%H%M.ts")
|
||||||
t = threading.Thread(target=download, args=(_preT,))
|
t = threading.Thread(target=download, args=(_preT,))
|
||||||
ut = threading.Thread(target=upload, args=(d,))
|
ut = threading.Thread(target=upload, args=(d,))
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if api.isLive:
|
if api.isLive:
|
||||||
if d is None:
|
if d is None:
|
||||||
|
Reference in New Issue
Block a user