3 from .common
import InfoExtractor
4 from ..utils
import make_archive_id
, remove_end
7 class CrtvgIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?crtvg\.es/tvg/a-carta/(?P<id>[^/#?]+)'
10 'url': 'https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623',
11 'md5': 'c0958d9ff90e4503a75544358758921d',
13 'id': 'os-caimans-do-tea-5839623',
14 'title': 'Os caimáns do Tea',
16 'description': 'md5:f71cfba21ae564f0a6f415b31de1f842',
17 'thumbnail': r
're:^https?://.*\.(?:jpg|png)',
18 '_old_archive_ids': ['crtvg 5839623'],
20 'params': {'skip_download': 'm3u8'},
22 'url': 'https://www.crtvg.es/tvg/a-carta/a-parabolica-love-story',
23 'md5': '9a47b95a1749db7b7eb3214904624584',
25 'id': 'a-parabolica-love-story',
26 'title': 'A parabólica / Trabuco, o can mordedor / Love Story',
28 'description': 'md5:f71cfba21ae564f0a6f415b31de1f842',
29 'thumbnail': r
're:^https?://.*\.(?:jpg|png)',
31 'params': {'skip_download': 'm3u8'},
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
36 webpage
= self
._download
_webpage
(url
, video_id
)
37 video_url
= self
._search
_regex
(r
'var\s+url\s*=\s*["\']([^
"\']+)', webpage, 'video url')
38 formats = self._extract_m3u8_formats(video_url + '/playlist.m3u8', video_id, fatal=False)
39 formats.extend(self._extract_mpd_formats(video_url + '/manifest.mpd', video_id, fatal=False))
42 if mobj := re.fullmatch(r'[^/#?]+-(?P<old_id>\d{7})', video_id):
43 old_video_id = [make_archive_id(self, mobj.group('old_id'))]
47 '_old_archive_ids': old_video_id,
49 'title': remove_end(self._html_search_meta(
50 ['og:title', 'twitter:title'], webpage, 'title', default=None), ' | CRTVG'),
51 'description': self._html_search_meta('description', webpage, 'description', default=None),
52 'thumbnail': self._html_search_meta(['og:image', 'twitter:image'], webpage, 'thumbnail', default=None),