]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/vidzi.py
[utils] Add base36 for use in Vidzi
[yt-dlp.git] / youtube_dl / extractor / vidzi.py
CommitLineData
5f6a1245 1# coding: utf-8
018e8355
PH
2from __future__ import unicode_literals
3
95ee8442 4from .common import InfoExtractor
92769650 5from ..utils import smuggle_url
95ee8442 6
018e8355 7
95ee8442 8class VidziIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)'
10 _TEST = {
2c26df76
PH
11 'url': 'http://vidzi.tv/cghql9yq6emu.html',
12 'md5': '4f16c71ca0c8c8635ab6932b5f3f1660',
95ee8442 13 'info_dict': {
2c26df76 14 'id': 'cghql9yq6emu',
95ee8442 15 'ext': 'mp4',
2c26df76 16 'title': 'youtube-dl test video 1\\\\2\'3/4<5\\\\6ä7↭',
bd93a12e
YCH
17 'uploader': 'vidzi.tv',
18 },
19 'params': {
20 # m3u8 download
21 'skip_download': True,
95ee8442 22 },
23 }
24
25 def _real_extract(self, url):
018e8355 26 video_id = self._match_id(url)
5f6a1245 27
018e8355 28 webpage = self._download_webpage(url, video_id)
018e8355 29 title = self._html_search_regex(
2c26df76 30 r'(?s)<h2 class="video-title">(.*?)</h2>', webpage, 'title')
5f6a1245 31
92769650 32 # Vidzi now uses jwplayer, which can be handled by GenericIE
95ee8442 33 return {
92769650 34 '_type': 'url_transparent',
95ee8442 35 'id': video_id,
36 'title': title,
92769650
YCH
37 'url': smuggle_url(url, {'to_generic': True}),
38 'ie_key': 'Generic',
95ee8442 39 }