Defend against non-string date value.

This commit is contained in:
dirkf 2022-10-31 13:39:55 +00:00 committed by GitHub
parent 911e22f970
commit cb2d26c472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,8 @@ from __future__ import unicode_literals
import re import re
from .common import InfoExtractor from .common import InfoExtractor
from .compat import compat_str
from ..utils import ( from ..utils import (
clean_html, clean_html,
int_or_none, int_or_none,
@ -108,7 +110,7 @@ class CCMAIE(InfoExtractor):
durada = informacio.get('durada') or {} durada = informacio.get('durada') or {}
duration = int_or_none(durada.get('milisegons'), 1000) or parse_duration(durada.get('text')) duration = int_or_none(durada.get('milisegons'), 1000) or parse_duration(durada.get('text'))
tematica = try_get(informacio, lambda x: x['tematica']['text']) tematica = try_get(informacio, lambda x: x['tematica']['text'])
timestamp = parse_iso8601(try_get(informacio, lambda x: x['data_emissio']['utc'])) timestamp = parse_iso8601(try_get(informacio, lambda x: x['data_emissio']['utc']), compat_str)
subtitles = {} subtitles = {}
subtitols = media.get('subtitols') or [] subtitols = media.get('subtitols') or []