From 77c22026242a27e3e04c850be64a10eab14a38c4 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sat, 6 May 2023 18:29:14 -0600 Subject: [PATCH] fix unavailable video crash --- process/threads.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/process/threads.py b/process/threads.py index 151c70b..6edbf58 100644 --- a/process/threads.py +++ b/process/threads.py @@ -80,13 +80,9 @@ def download_video(args) -> dict: video = args[0] kwargs = args[1] - # Clean the strings of forign languages - video['title'] = unidecode(video['title']) - video['uploader'] = unidecode(video['uploader']) - output_dict = {'downloaded_video_id': None, 'video_id': video['id'], 'video_critical_err_msg': [], 'video_critical_err_msg_short': [], 'status_msg': [], 'logger_msg': []} # empty object - if not kwargs['ignore_downloaded'] and not video['channel_id'] or not video['channel'] or not video['channel_url']: + if not kwargs['ignore_downloaded'] and not video['channel_id'] or not video['channel'] or not video['channel_url'] or 'uploader' not in video.keys(): if video['duration'] or isinstance(video['view_count'], int): # Sometimes videos don't have channel_id, channel, or channel_url but are actually valid. Like shorts. pass @@ -94,6 +90,10 @@ def download_video(args) -> dict: output_dict['video_critical_err_msg_short'].append('unavailable.') return output_dict + # Clean the strings of forign languages + video['title'] = unidecode(video['title']) + video['uploader'] = unidecode(video['uploader']) + # Get a bar locked = False if len(kwargs['bars']):