Change some ifs
This commit is contained in:
parent
960f2527b2
commit
735f77724e
|
@ -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)
|
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()
|
stdout, stderr = await proc.communicate()
|
||||||
if not proc.returncode:
|
if not proc.returncode:
|
||||||
if not waited:
|
if not waited and video_json.get('is_live'):
|
||||||
first_try_live = True
|
first_try_live = True
|
||||||
break
|
break
|
||||||
wait_time = 30
|
wait_time = 30
|
||||||
|
@ -89,8 +89,6 @@ async def _check_video(video):
|
||||||
await asyncio.sleep(wait_time)
|
await asyncio.sleep(wait_time)
|
||||||
waited = True
|
waited = True
|
||||||
video_json = json.loads(stdout)
|
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.put_nowait((video_json, time.time(), first_try_live))
|
||||||
|
|
||||||
video_queue = asyncio.Queue()
|
video_queue = asyncio.Queue()
|
||||||
|
|
Loading…
Reference in New Issue