- video_title = self._html_search_regex(r'<title>(?P<title>.+?)\|',
- webpage, u'title')
- video_description = self._html_search_regex(r'<div class="entry-content">(?P<description>.+?)</div>',
- webpage, u'description', flags=re.DOTALL, fatal=False)
- if len(video_description) == 0:
- video_description = None
-
- playerdata = self._download_webpage(playerdata_url, video_id)
- base_url = self._html_search_regex(r'\'streamer\': \'(?P<base_url>rtmp://[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/(?:vod|Cinemassacre)\'',
- playerdata, u'base_url')
- base_url += '/Cinemassacre/'
- # Important: The file names in playerdata are not used by the player and even wrong for some videos
- sd_file = 'Cinemassacre-%s_high.mp4' % video_id
- hd_file = 'Cinemassacre-%s.mp4' % video_id
- video_thumbnail = 'http://image.screenwavemedia.com/Cinemassacre/Cinemassacre-%s_thumb_640x360.jpg' % video_id
-
- formats = [{
- 'id': video_id,
- 'url': base_url + hd_file,
- 'format': 'hd',
- 'ext': 'mp4',
- 'title': video_title,
- 'description': video_description,
- 'upload_date': video_date,
- 'thumbnail': video_thumbnail,
- },
- {
- 'id': video_id,
- 'url': base_url + sd_file,
- 'ext': 'mp4',
- 'format': 'sd',
- 'title': video_title,
- 'description': video_description,
- 'upload_date': video_date,
- 'thumbnail': video_thumbnail,
- }]
-
- if self._downloader.params.get('listformats', None):
- self._print_formats(formats)
- return
+ playerdata_url = self._search_regex(
+ [
+ ScreenwaveMediaIE.EMBED_PATTERN,
+ r'<iframe[^>]+src="(?P<url>(?:https?:)?//(?:[^.]+\.)?youtube\.com/.+?)"',
+ ],
+ webpage, 'player data URL', default=None, group='url')
+ if not playerdata_url:
+ raise ExtractorError('Unable to find player data')