[ie/twitter:spaces] Support video spaces (#10789)
[yt-dlp3.git] / yt_dlp / extractor / canal1.py
blob587a11ab8c14d36567596cc589ca935f66e3256e
1 from .common import InfoExtractor
4 class Canal1IE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.|noticias\.)?canal1\.com\.co/(?:[^?#&])+/(?P<id>[\w-]+)'
7 _TESTS = [{
8 'url': 'https://canal1.com.co/noticias/napa-i-una-cadena-de-produccion-de-arroz-que-se-quedo-en-veremos-y-abandonada-en-el-departamento-del-choco/',
9 'info_dict': {
10 'id': '63b39f6b354977084b85ab54',
11 'display_id': 'napa-i-una-cadena-de-produccion-de-arroz-que-se-quedo-en-veremos-y-abandonada-en-el-departamento-del-choco',
12 'title': 'Ñapa I Una cadena de producción de arroz que se quedó en veremos y abandonada en el departamento del Chocó',
13 'description': 'md5:bc49c6d64d20610ea1e7daf079a0d013',
14 'thumbnail': r're:^https?://[^?#]+63b39f6b354977084b85ab54',
15 'ext': 'mp4',
17 }, {
18 'url': 'https://noticias.canal1.com.co/noticias/tres-i-el-triste-record-que-impuso-elon-musk-el-dueno-de-tesla-y-de-twitter/',
19 'info_dict': {
20 'id': '63b39e93f5fd223aa32250fb',
21 'display_id': 'tres-i-el-triste-record-que-impuso-elon-musk-el-dueno-de-tesla-y-de-twitter',
22 'title': 'Tres I El triste récord que impuso Elon Musk, el dueño de Tesla y de Twitter',
23 'description': 'md5:d9f691f131a21ce6767ca6c05d17d791',
24 'thumbnail': r're:^https?://[^?#]+63b39e93f5fd223aa32250fb',
25 'ext': 'mp4',
27 }, {
28 # Geo-restricted to Colombia
29 'url': 'https://canal1.com.co/programas/guerreros-canal-1/video-inedito-guerreros-despedida-kewin-zarate/',
30 'only_matching': True,
33 def _real_extract(self, url):
34 display_id = self._match_id(url)
35 webpage = self._download_webpage(url, display_id)
37 return self.url_result(
38 self._search_regex(r'"embedUrl"\s*:\s*"([^"]+)', webpage, 'embed url'),
39 display_id=display_id, url_transparent=True)