]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/biobiochiletv.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..utils
import remove_end
8 class BioBioChileTVIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://tv\.biobiochile\.cl/notas/(?:[^/]+/)+(?P<id>[^/]+)\.shtml'
12 'url': 'http://tv.biobiochile.cl/notas/2015/10/21/sobre-camaras-y-camarillas-parlamentarias.shtml',
13 'md5': '26f51f03cf580265defefb4518faec09',
15 'id': 'sobre-camaras-y-camarillas-parlamentarias',
17 'title': 'Sobre Cámaras y camarillas parlamentarias',
18 'thumbnail': 're:^https?://.*\.jpg$',
19 'uploader': 'Fernando Atria',
22 # different uploader layout
23 'url': 'http://tv.biobiochile.cl/notas/2016/03/18/natalia-valdebenito-repasa-a-diputado-hasbun-paso-a-la-categoria-de-hablar-brutalidades.shtml',
24 'md5': 'edc2e6b58974c46d5b047dea3c539ff3',
26 'id': 'natalia-valdebenito-repasa-a-diputado-hasbun-paso-a-la-categoria-de-hablar-brutalidades',
28 'title': 'Natalia Valdebenito repasa a diputado Hasbún: Pasó a la categoría de hablar brutalidades',
29 'thumbnail': 're:^https?://.*\.jpg$',
30 'uploader': 'Piangella Obrador',
33 'skip_download': True,
36 'url': 'http://tv.biobiochile.cl/notas/2015/10/22/ninos-transexuales-de-quien-es-la-decision.shtml',
37 'only_matching': True,
39 'url': 'http://tv.biobiochile.cl/notas/2015/10/21/exclusivo-hector-pinto-formador-de-chupete-revela-version-del-ex-delantero-albo.shtml',
40 'only_matching': True,
43 def _real_extract(self
, url
):
44 video_id
= self
._match
_id
(url
)
46 webpage
= self
._download
_webpage
(url
, video_id
)
48 title
= remove_end(self
._og
_search
_title
(webpage
), ' - BioBioChile TV')
50 file_url
= self
._search
_regex
(
51 r
'loadFWPlayerVideo\([^,]+,\s*(["\'])(?P
<url
>.+?
)\
1',
52 webpage, 'file url
', group='url
')
54 base_url = self._search_regex(
55 r'file\s
*:\s
*(["\'])(?P<url>.+?)\1\s*\+\s*fileURL', webpage,
56 'base url', default='http://unlimited2-cl.digitalproserver.com/bbtv/',
59 formats = self._extract_m3u8_formats(
60 '%s%s/playlist.m3u8' % (base_url, file_url), video_id, 'mp4',
61 entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
63 'url': '%s%s' % (base_url, file_url),
69 f_copy = formats[-1].copy()
73 self._sort_formats(formats)
75 thumbnail = self._og_search_thumbnail(webpage)
76 uploader = self._html_search_regex(
77 r'<a[^>]+href=["\']https?
://busca\
.biobiochile\
.cl
/author
[^
>]+>(.+?
)</a
>',
78 webpage, 'uploader
', fatal=False)
83 'thumbnail
': thumbnail,