]>
Commit | Line | Data |
---|---|---|
dcfad528 EL |
1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class ElTreceTVIE(InfoExtractor): | |
5 | IE_DESC = 'El Trece TV (Argentina)' | |
6 | _VALID_URL = r'https?://(?:www\.)?eltrecetv\.com\.ar/[\w-]+/capitulos/temporada-\d+/(?P<id>[\w-]+)' | |
7 | _TESTS = [ | |
8 | { | |
9 | 'url': 'https://www.eltrecetv.com.ar/ahora-caigo/capitulos/temporada-2023/programa-del-061023/', | |
10 | 'md5': '71a66673dc63f9a5939d97bfe4b311ba', | |
11 | 'info_dict': { | |
12 | 'id': 'AHCA05102023145553329621094', | |
13 | 'ext': 'mp4', | |
14 | 'title': 'AHORA CAIGO - Programa 06/10/23', | |
15 | 'thumbnail': 'https://thumbs.vodgc.net/AHCA05102023145553329621094.JPG?649339', | |
16 | } | |
17 | }, | |
18 | { | |
19 | 'url': 'https://www.eltrecetv.com.ar/poco-correctos/capitulos/temporada-2023/programa-del-250923-invitada-dalia-gutmann/', | |
20 | 'only_matching': True, | |
21 | }, | |
22 | { | |
23 | 'url': 'https://www.eltrecetv.com.ar/argentina-tierra-de-amor-y-venganza/capitulos/temporada-2023/atav-2-capitulo-121-del-250923/', | |
24 | 'only_matching': True, | |
25 | }, | |
26 | { | |
27 | 'url': 'https://www.eltrecetv.com.ar/ahora-caigo/capitulos/temporada-2023/programa-del-250923/', | |
28 | 'only_matching': True, | |
29 | }, | |
30 | { | |
31 | 'url': 'https://www.eltrecetv.com.ar/pasaplatos/capitulos/temporada-2023/pasaplatos-el-restaurante-del-250923/', | |
32 | 'only_matching': True, | |
33 | }, | |
34 | { | |
35 | 'url': 'https://www.eltrecetv.com.ar/el-galpon/capitulos/temporada-2023/programa-del-160923-invitado-raul-lavie/', | |
36 | 'only_matching': True, | |
37 | } | |
38 | ] | |
39 | ||
40 | def _real_extract(self, url): | |
41 | slug = self._match_id(url) | |
42 | webpage = self._download_webpage(url, slug) | |
43 | config = self._search_json( | |
44 | r'Fusion.globalContent\s*=', webpage, 'content', slug)['promo_items']['basic']['embed']['config'] | |
45 | video_url = config['m3u8'] | |
46 | video_id = self._search_regex(r'/(\w+)\.m3u8', video_url, 'video id', default=slug) | |
47 | ||
48 | formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_url, video_id, 'mp4', m3u8_id='hls') | |
49 | formats.extend([{ | |
50 | 'url': f['url'][:-23], | |
51 | 'format_id': f['format_id'].replace('hls', 'http'), | |
52 | 'width': f.get('width'), | |
53 | 'height': f.get('height'), | |
54 | } for f in formats if f['url'].endswith('/tracks-v1a1/index.m3u8') and f.get('height') != 1080]) | |
55 | ||
56 | return { | |
57 | 'id': video_id, | |
58 | 'title': config.get('title'), | |
59 | 'thumbnail': config.get('thumbnail'), | |
60 | 'formats': formats, | |
61 | 'subtitles': subtitles, | |
62 | } |