ffprobe json may not be valid, the video should still be retrieved.

This commit is contained in:
Roland 2023-09-07 13:01:35 -06:00
parent f44ac91319
commit 3e39102a55
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -58,9 +58,13 @@ class Video(ModelHelper, Base):
codec_names = []
codec_types = []
if self.ffprobe_json:
codec_names = [i['codec_name'] for i in self.ffprobe_json['streams']]
codec_types = [i['codec_type'] for i in self.ffprobe_json['streams']]
try:
if self.ffprobe_json:
codec_names = [i['codec_name'] for i in self.ffprobe_json['streams']]
codec_types = [i['codec_type'] for i in self.ffprobe_json['streams']]
except Exception as e:
logger.error(f'{self} ffprobe_json is invalid', exc_info=e)
# Put live data in "video" instead of "data" to avoid confusion on the frontend.
d['video'] = dict(