From 990be67d565fc2b05ddb038e35915d39035ef3ec Mon Sep 17 00:00:00 2001 From: blank X Date: Thu, 14 Jan 2021 23:18:55 +0700 Subject: [PATCH] Revert "Change some ifs" This reverts commit 735f77724e28a787e7d496c3ce214adca687b7c8. --- autoytarchive/workers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoytarchive/workers.py b/autoytarchive/workers.py index 40f3fc0..d0d95d5 100644 --- a/autoytarchive/workers.py +++ b/autoytarchive/workers.py @@ -70,7 +70,7 @@ async def _check_video(video): proc = await asyncio.create_subprocess_exec(sys.executable, 'youtube-dl-injected.py', '--dump-single-json', video['link'], stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) stdout, stderr = await proc.communicate() if not proc.returncode: - if not waited and video_json.get('is_live'): + if not waited: first_try_live = True break wait_time = 30 @@ -89,6 +89,8 @@ async def _check_video(video): await asyncio.sleep(wait_time) waited = True video_json = json.loads(stdout) + if not video_json.get('is_live') and first_try_live: + first_try_live = False video_queue.put_nowait((video_json, time.time(), first_try_live)) video_queue = asyncio.Queue()