Handle possible None
This commit is contained in:
parent
85e9d7595d
commit
324bc609ec
|
@ -78,9 +78,11 @@ async def _check_video(video):
|
|||
if error_message:
|
||||
error_message = error_message[7:]
|
||||
if error_message.startswith('AUTOYTARCHIVE:'):
|
||||
new_wait_time = int(error_message.split(':', 1)[1].split(' ', 1)[0]) - int(time.time())
|
||||
if new_wait_time > 0:
|
||||
wait_time = new_wait_time
|
||||
tmp = error_message.split(':', 1)[1].split(' ', 1)[0]
|
||||
if tmp.isnumeric():
|
||||
new_wait_time = int(tmp) - int(time.time())
|
||||
if new_wait_time > 0:
|
||||
wait_time = new_wait_time
|
||||
logging.error('Error on video %s: %s', video['yt_videoid'], error_message)
|
||||
else:
|
||||
logging.error('Video %s returned status code %s\n%s', video['yt_videoid'], proc.returncode, (stderr + stdout).decode())
|
||||
|
|
Loading…
Reference in New Issue