]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vidzi.py
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
   7 class VidziIE(InfoExtractor
): 
   8     _VALID_URL 
= r
'https?://(?:www\.)?vidzi\.tv/(?P<id>\w+)' 
  10         'url': 'http://vidzi.tv/cghql9yq6emu.html', 
  11         'md5': '4f16c71ca0c8c8635ab6932b5f3f1660', 
  15             'title': 'youtube-dl test video  1\\\\2\'3/4<5\\\\6ä7↭', 
  19     def _real_extract(self
, url
): 
  20         video_id 
= self
._match
_id
(url
) 
  22         webpage 
= self
._download
_webpage
(url
, video_id
) 
  23         video_host 
= self
._html
_search
_regex
( 
  24             r
'id=\'vplayer
\'><img src
="http://(.*?)/i', webpage, 
  26         video_hash = self._html_search_regex( 
  27             r'\|([a-z0-9]+)\|hls\|type', webpage, 'video_hash') 
  28         ext = self._html_search_regex( 
  29             r'\|tracks\|([a-z0-9]+)\|', webpage, 'video ext') 
  30         video_url = 'http://' + video_host + '/' + video_hash + '/v.' + ext 
  31         title = self._html_search_regex( 
  32             r'(?s)<h2 class="video
-title
">(.*?)</h2>', webpage, 'title')