mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00:00
parent
4390d5ec12
commit
e66662b1e0
|
@ -1,17 +1,14 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import calendar
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
clean_html,
|
clean_html,
|
||||||
extract_timezone,
|
|
||||||
int_or_none,
|
int_or_none,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
parse_resolution,
|
parse_resolution,
|
||||||
try_get,
|
try_get,
|
||||||
|
unified_timestamp,
|
||||||
url_or_none,
|
url_or_none,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -95,14 +92,8 @@ def _real_extract(self, url):
|
||||||
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 = None
|
|
||||||
data_utc = try_get(informacio, lambda x: x['data_emissio']['utc'])
|
data_utc = try_get(informacio, lambda x: x['data_emissio']['utc'])
|
||||||
try:
|
timestamp = unified_timestamp(data_utc)
|
||||||
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
|
|
||||||
|
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
subtitols = media.get('subtitols') or []
|
subtitols = media.get('subtitols') or []
|
||||||
|
|
Loading…
Reference in a new issue