diff options
author | nyuszika7h <nyuszika7h@gmail.com> | 2022-03-08 17:45:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-08 08:45:23 -0800 |
commit | e66662b1e031640521e12e1e7e57ea7b4a36b5fa (patch) | |
tree | 6b65c18dcccd7b876d50ec4fc2d75df2d3b12cb2 | |
parent | 4390d5ec12349e5b5bba30af6b4e7f08678af41a (diff) | |
download | hypervideo-pre-e66662b1e031640521e12e1e7e57ea7b4a36b5fa.tar.lz hypervideo-pre-e66662b1e031640521e12e1e7e57ea7b4a36b5fa.tar.xz hypervideo-pre-e66662b1e031640521e12e1e7e57ea7b4a36b5fa.zip |
[ccma] Fix timestamp parsing (#2989)
Authored by: nyuszika7h
-rw-r--r-- | yt_dlp/extractor/ccma.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/yt_dlp/extractor/ccma.py b/yt_dlp/extractor/ccma.py index ea98f8688..9dbaabfa0 100644 --- a/yt_dlp/extractor/ccma.py +++ b/yt_dlp/extractor/ccma.py @@ -1,17 +1,14 @@ # coding: utf-8 from __future__ import unicode_literals -import calendar -import datetime - from .common import InfoExtractor from ..utils import ( clean_html, - extract_timezone, int_or_none, parse_duration, parse_resolution, try_get, + unified_timestamp, url_or_none, ) @@ -95,14 +92,8 @@ class CCMAIE(InfoExtractor): duration = int_or_none(durada.get('milisegons'), 1000) or parse_duration(durada.get('text')) tematica = try_get(informacio, lambda x: x['tematica']['text']) - timestamp = None data_utc = try_get(informacio, lambda x: x['data_emissio']['utc']) - try: - timezone, data_utc = extract_timezone(data_utc) - timestamp = calendar.timegm((datetime.datetime.strptime( - data_utc, '%Y-%d-%mT%H:%M:%S') - timezone).timetuple()) - except TypeError: - pass + timestamp = unified_timestamp(data_utc) subtitles = {} subtitols = media.get('subtitols') or [] |