From 5962ecc6909ce0d3db7135da40b543bf30d5d591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sun, 7 Jul 2019 20:26:14 -0300 Subject: [PATCH] [vera] Add extractor for channels --- docs/supportedsites.md | 1 + youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/vera.py | 80 ++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 youtube_dl/extractor/vera.py diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 55ae43144..c2d0b4d35 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -997,6 +997,7 @@ - **Vbox7** - **VeeHD** - **Veoh** + - **Vera** - **verystream** - **Vessel** - **Vesti**: Вести.Ru diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 02f17cf0d..46141ca29 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1280,6 +1280,7 @@ from .varzesh3 import Varzesh3IE from .vbox7 import Vbox7IE from .veehd import VeeHDIE from .veoh import VeohIE +from .vera import VeraIE from .vessel import VesselIE from .vesti import VestiIE from .vevo import ( diff --git a/youtube_dl/extractor/vera.py b/youtube_dl/extractor/vera.py new file mode 100644 index 000000000..059fb48e9 --- /dev/null +++ b/youtube_dl/extractor/vera.py @@ -0,0 +1,80 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class VeraIE(InfoExtractor): + _VALID_URL = r'https?://tv\.vera\.com\.uy/canal/(?P[0-9]+)' + _TESTS = [{ + 'url': 'http://tv.vera.com.uy/canal/6001', + 'info_dict': { + 'id': '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', + 'thumbnail': r're:^https?://.*\.jpg$', + }, + 'params': { + 'skip_download': True, + } + }, { + 'url': 'http://tv.vera.com.uy/canal/6042', + 'info_dict': { + 'id': '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', + 'thumbnail': r're:^https?://.*\.jpg$', + }, + 'params': { + 'skip_download': True, + } + }, { + 'url': 'http://tv.vera.com.uy/canal/6046', + 'info_dict': { + 'id': '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', + 'thumbnail': r're:^https?://.*\.jpg$', + }, + 'params': { + 'skip_download': True, + } + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + title = self._html_search_regex( + r'

(.+?)

', + webpage, 'title') + description = self._html_search_regex( + r'(?s)

(.+?)

', + webpage, 'description') + thumbnail = self._html_search_regex( + r'(?s)
\s*