1 from __future__ import unicode_literals
6 from .common import InfoExtractor
9 class VideoPremiumIE(InfoExtractor):
10 _VALID_URL = r'https?://(?:www\.)?videopremium\.(?:tv|me)/(?P<id>\w+)(?:/.*)?'
12 'url': 'http://videopremium.tv/4w7oadjsf156',
16 'title': 'youtube-dl_test_video____a_________-BaW_jenozKc.mp4.mp4'
19 'skip_download': True,
21 'skip': 'Test file has been deleted.',
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
26 webpage_url = 'http://videopremium.tv/' + video_id
27 webpage = self._download_webpage(webpage_url, video_id)
29 if re.match(r"^<html><head><script[^>]*>window.location\s*=", webpage):
30 # Download again, we need a cookie
31 webpage = self._download_webpage(
32 webpage_url, video_id,
33 note='Downloading webpage again (with cookie)')
35 video_title = self._html_search_regex(
36 r'<h2(?:.*?)>\s*(.+?)\s*<', webpage, 'video title')
40 'url': "rtmp://e%d.md.iplay.md/play" % random.randint(1, 16),
41 'play_path': "mp4:%s.f4v" % video_id,
42 'page_url': "http://videopremium.tv/" + video_id,
43 'player_url': "http://videopremium.tv/uplayer/uppod.swf",