mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -08:00
[vera] Add support for videos
This commit is contained in:
parent
5962ecc690
commit
9b49b029c6
@ -5,11 +5,11 @@ from .common import InfoExtractor
|
||||
|
||||
|
||||
class VeraIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://tv\.vera\.com\.uy/canal/(?P<id>[0-9]+)'
|
||||
_VALID_URL = r'https?://tv\.vera\.com\.uy/(?P<id>(?:canal|video)/[0-9]+)'
|
||||
_TESTS = [{
|
||||
'url': 'http://tv.vera.com.uy/canal/6001',
|
||||
'info_dict': {
|
||||
'id': '6001',
|
||||
'id': 'canal/6001',
|
||||
'ext': 'mp4',
|
||||
'title': r're:^Vera\+ HD [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
||||
'description': 'md5:b3696ac8131004491079f61650856444',
|
||||
@ -21,7 +21,7 @@ class VeraIE(InfoExtractor):
|
||||
}, {
|
||||
'url': 'http://tv.vera.com.uy/canal/6042',
|
||||
'info_dict': {
|
||||
'id': '6042',
|
||||
'id': 'canal/6042',
|
||||
'ext': 'mp4',
|
||||
'title': r're:^Televisión Nacional [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
||||
'description': 'md5:91472413c939a91c45ad50f2d5ccf453',
|
||||
@ -33,7 +33,7 @@ class VeraIE(InfoExtractor):
|
||||
}, {
|
||||
'url': 'http://tv.vera.com.uy/canal/6046',
|
||||
'info_dict': {
|
||||
'id': '6046',
|
||||
'id': 'canal/6046',
|
||||
'ext': 'mp4',
|
||||
'title': r're:^TVCIUDAD [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
||||
'description': 'md5:aaee7e00ac0b0b1c04766f77fed6bbe9',
|
||||
@ -42,21 +42,41 @@ class VeraIE(InfoExtractor):
|
||||
'params': {
|
||||
'skip_download': True,
|
||||
}
|
||||
}, {
|
||||
'url': 'http://tv.vera.com.uy/video/38351',
|
||||
'md5': '6d7a5530c6041ac3808438c0584cbbfc',
|
||||
'info_dict': {
|
||||
'id': 'video/38351',
|
||||
'ext': 'mp4',
|
||||
'title': r'Mario Orlando Hardy Hamlet Brenno Benedetti Farrugia',
|
||||
'description': None,
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
}
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
title = self._html_search_regex(
|
||||
r'<h2 id="titulo_programa">(.+?)</h2>',
|
||||
webpage, 'title')
|
||||
description = self._html_search_regex(
|
||||
r'(?s)<p id="desc_programa">(.+?)</p>',
|
||||
webpage, 'description')
|
||||
thumbnail = self._html_search_regex(
|
||||
r'(?s)<div class="infoCanal">\s*<img src="(.+?)"',
|
||||
webpage, 'thumbnail')
|
||||
cat, num = video_id.split("/")
|
||||
|
||||
if cat == "canal":
|
||||
title = self._html_search_regex(
|
||||
r'<h2 id="titulo_programa">(.+?)</h2>',
|
||||
webpage, 'title')
|
||||
title = self._live_title(title)
|
||||
description = self._html_search_regex(
|
||||
r'(?s)<p id="desc_programa">(.+?)</p>',
|
||||
webpage, 'description')
|
||||
thumbnail = self._html_search_regex(
|
||||
r'(?s)<div class="infoCanal">\s*<img src="(.+?)"',
|
||||
webpage, 'thumbnail')
|
||||
else:
|
||||
title = self._html_search_regex(
|
||||
r'(?s)<div class="video-title left">\s*<h2 class="left">(.+?)</h2>',
|
||||
webpage, 'title')
|
||||
description = None
|
||||
thumbnail = "http://veratvimgs.cdn.antel.net.uy/dynamic/content_images/" + num + "/240/default.jpg"
|
||||
|
||||
iframe_url = self._html_search_regex(
|
||||
r'#iframePlayerContent\'.*\'(http:\/\/.*extras.*)\'',
|
||||
@ -72,7 +92,7 @@ class VeraIE(InfoExtractor):
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': self._live_title(title),
|
||||
'title': title,
|
||||
'description': description,
|
||||
'thumbnail': thumbnail,
|
||||
'url': playlist_url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user