From d0a6aadb56cc2f44c01d019dfd3413ef2a93852d Mon Sep 17 00:00:00 2001 From: Jerry-Lubo-Server <792602257@qq.com> Date: Thu, 9 Apr 2020 08:36:01 +0800 Subject: [PATCH] TEST2 --- liveDownloader.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/liveDownloader.py b/liveDownloader.py index 728af2c..1c6965b 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -11,13 +11,15 @@ def download(): while Common.api.isLive and not Common.forceNotDownload: if not Common.streamUrl: Common.appendError("Download with No StreamUrl Specific") - Common.api.updRoomInfo(True) break path = datetime.strftime(datetime.now(), "%Y%m%d_%H%M.flv") - p = session.get(Common.streamUrl, stream=True, timeout=3) + try: + p = session.get(Common.streamUrl, stream=True, timeout=3) + except Exception as e: + Common.appendError("Download >{}< with Exception [{}]".format(path,e.__str__())) + break if p.status_code != 200: Common.appendDownloadStatus("Download with Response {}".format(p.status_code)) - Common.api.updRoomInfo(True) break Common.appendDownloadStatus("Download >{}< Start".format(path)) f = open(path, "wb") @@ -42,8 +44,9 @@ def download(): if os.path.getsize(path) < 1024 * 1024: Common.modifyLastDownloadStatus("Downloaded File >{}< is too small, will ignore it".format(path)) os.remove(path) - break + continue Common.encodeQueue.put(path) + Common.api.updRoomInfo(True) def encode():