]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/telemundo.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class TelemundoIE(InfoExtractor
):
14 _VALID_URL
= r
'https?:\/\/(?:www\.)?telemundo\.com\/.+?video\/[^\/]+(?P<id>tmvo\d{7})'
16 'url': 'https://www.telemundo.com/noticias/noticias-telemundo-en-la-noche/empleo/video/esta-aplicacion-gratuita-esta-ayudando-los-latinos-encontrar-trabajo-en-estados-unidos-tmvo9829325',
19 'timestamp': 1621396800,
20 'title': 'Esta aplicación gratuita está ayudando a los latinos a encontrar trabajo en Estados Unidos',
21 'uploader': 'Telemundo',
22 'uploader_id': 'NBCU_Telemundo',
24 'upload_date': '20210519',
27 'skip_download': True,
30 'url': 'https://www.telemundo.com/shows/al-rojo-vivo/empleo/video/personajes-de-times-square-piden-que-la-ciudad-de-nueva-york-los-deje-volver-trabajar-tmvo9816272',
31 'only_matching': True,
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
36 webpage
= self
._download
_webpage
(url
, video_id
)
37 metadata
= self
._search
_nextjs
_data
(webpage
, video_id
)
38 redirect_url
= try_get(
40 lambda x
: x
['props']['initialState']['video']['associatedPlaylists'][0]['videos'][0]['videoAssets'][0]['publicUrl'])
42 m3u8_url
= self
._request
_webpage
(HEADRequest(
43 redirect_url
+ '?format=redirect&manifest=m3u&format=redirect&Tracking=true&Embedded=true&formats=MPEG4'),
44 video_id
, 'Processing m3u8').geturl()
45 formats
= self
._extract
_m
3u8_formats
(m3u8_url
, video_id
, 'mp4')
46 self
._sort
_formats
(formats
)
47 date
= unified_timestamp(try_get(
48 metadata
, lambda x
: x
['props']['initialState']['video']['associatedPlaylists'][0]['videos'][0]['datePublished'].split(' ', 1)[1]))
52 'title': self
._search
_regex
(r
'<h1[^>]+>([^<]+)', webpage
, 'title', fatal
=False),
55 'uploader': 'Telemundo',
56 'uploader_id': self
._search
_regex
(r
'https?:\/\/(?:[^/]+\/){3}video\/(?P<id>[^\/]+)', m3u8_url
, 'Akamai account', fatal
=False)