2 from __future__ import unicode_literals
6 from .common import InfoExtractor
12 from .bliptv import BlipTVIE
15 class ScreenwaveMediaIE(InfoExtractor):
16 _VALID_URL = r'http://player\.screenwavemedia\.com/play/[a-zA-Z]+\.php\?[^"]*\bid=(?P<id>.+)'
19 'url': 'http://player.screenwavemedia.com/play/play.php?playerdiv=videoarea&companiondiv=squareAd&id=Cinemassacre-19911',
20 'only_matching': True,
23 def _real_extract(self, url):
24 video_id = self._match_id(url)
25 playerdata = self._download_webpage(url, video_id, 'Downloading player webpage')
27 vidtitle = self._search_regex(
28 r'\'vidtitle\'\s*:\s*"([^"]+)"', playerdata, 'vidtitle').replace('\\/', '/')
29 vidurl = self._search_regex(
30 r'\'vidurl\'\s*:\s*"([^"]+)"', playerdata, 'vidurl').replace('\\/', '/')
34 mobj = re.search(r"'videoserver'\s*:\s*'(?P<videoserver>[^']+)'", playerdata)
36 videoserver = mobj.group('videoserver')
37 mobj = re.search(r'\'vidid\'\s*:\s*"(?P<vidid>[^\']+)"', playerdata)
38 vidid = mobj.group('vidid') if mobj else video_id
39 videolist_url = 'http://%s/vod/smil:%s.smil/jwplayer.smil' % (videoserver, vidid)
41 mobj = re.search(r"file\s*:\s*'(?P<smil>http.+?/jwplayer\.smil)'", playerdata)
43 videolist_url = mobj.group('smil')
46 videolist = self._download_xml(videolist_url, video_id, 'Downloading videolist XML')
48 baseurl = vidurl[:vidurl.rfind('/') + 1]
49 for video in videolist.findall('.//video'):
50 src = video.get('src')
53 file_ = src.partition(':')[-1]
54 width = int_or_none(video.get('width'))
55 height = int_or_none(video.get('height'))
56 bitrate = int_or_none(video.get('system-bitrate'), scale=1000)
58 'url': baseurl + file_,
59 'format_id': src.rpartition('.')[0].rpartition('_')[-1],
72 formats.append(format)
77 self._sort_formats(formats)
86 class CinemassacreIE(InfoExtractor):
87 _VALID_URL = 'https?://(?:www\.)?cinemassacre\.com/(?P<date_y>[0-9]{4})/(?P<date_m>[0-9]{2})/(?P<date_d>[0-9]{2})/(?P<display_id>[^?#/]+)'
90 'url': 'http://cinemassacre.com/2012/11/10/avgn-the-movie-trailer/',
91 'md5': 'fde81fbafaee331785f58cd6c0d46190',
93 'id': 'Cinemassacre-19911',
95 'upload_date': '20121110',
96 'title': '“Angry Video Game Nerd: The Movie” – Trailer',
97 'description': 'md5:fb87405fcb42a331742a0dce2708560b',
101 'url': 'http://cinemassacre.com/2013/10/02/the-mummys-hand-1940',
102 'md5': 'd72f10cd39eac4215048f62ab477a511',
104 'id': 'Cinemassacre-521be8ef82b16',
106 'upload_date': '20131002',
107 'title': 'The Mummy’s Hand (1940)',
111 'url': 'http://cinemassacre.com/2006/12/07/chronologically-confused-about-bad-movie-and-video-game-sequel-titles/',
112 'md5': 'ca9b3c8dd5a66f9375daeb5135f5a3de',
116 'title': 'AVGN: Chronologically Confused about Bad Movie and Video Game Sequel Titles',
117 'upload_date': '20061207',
118 'uploader': 'cinemassacre',
119 'uploader_id': '250778',
120 'timestamp': 1283233867,
121 'description': 'md5:0a108c78d130676b207d0f6d029ecffd',
126 def _real_extract(self, url):
127 mobj = re.match(self._VALID_URL, url)
128 display_id = mobj.group('display_id')
129 video_date = mobj.group('date_y') + mobj.group('date_m') + mobj.group('date_d')
131 webpage = self._download_webpage(url, display_id)
133 playerdata_url = self._search_regex(
134 r'src="(http://player\.screenwavemedia\.com/play/[a-zA-Z]+\.php\?[^"]*\bid=.+?)"',
135 webpage, 'player data URL', default=None)
136 if not playerdata_url:
137 playerdata_url = BlipTVIE._extract_url(webpage)
138 if not playerdata_url:
139 raise ExtractorError('Unable to find player data')
141 video_title = self._html_search_regex(
142 r'<title>(?P<title>.+?)\|', webpage, 'title')
143 video_description = self._html_search_regex(
144 r'<div class="entry-content">(?P<description>.+?)</div>',
145 webpage, 'description', flags=re.DOTALL, fatal=False)
146 video_thumbnail = self._og_search_thumbnail(webpage)
149 '_type': 'url_transparent',
150 'display_id': display_id,
151 'title': video_title,
152 'description': video_description,
153 'upload_date': video_date,
154 'thumbnail': video_thumbnail,
155 'url': playerdata_url,
159 class TeamFourIE(InfoExtractor):
160 _VALID_URL = r'https?://(?:www\.)?teamfourstar\.com/video/(?P<id>[a-z0-9\-]+)/?'
162 'url': 'http://teamfourstar.com/video/a-moment-with-tfs-episode-4/',
164 'id': 'TeamFourStar-5292a02f20bfa',
166 'upload_date': '20130401',
167 'description': 'Check out this and more on our website: http://teamfourstar.com\nTFS Store: http://sharkrobot.com/team-four-star\nFollow on Twitter: http://twitter.com/teamfourstar\nLike on FB: http://facebook.com/teamfourstar',
168 'title': 'A Moment With TFS Episode 4',
172 def _real_extract(self, url):
173 display_id = self._match_id(url)
174 webpage = self._download_webpage(url, display_id)
176 playerdata_url = self._search_regex(
177 r'src="(http://player\.screenwavemedia\.com/play/[a-zA-Z]+\.php\?[^"]*\bid=.+?)"',
178 webpage, 'player data URL')
180 video_title = self._html_search_regex(
181 r'<div class="heroheadingtitle">(?P<title>.+?)</div>',
183 video_date = unified_strdate(self._html_search_regex(
184 r'<div class="heroheadingdate">(?P<date>.+?)</div>',
185 webpage, 'date', fatal=False))
186 video_description = self._html_search_regex(
187 r'(?s)<div class="postcontent">(?P<description>.+?)</div>',
188 webpage, 'description', fatal=False)
189 video_thumbnail = self._og_search_thumbnail(webpage)
192 '_type': 'url_transparent',
193 'display_id': display_id,
194 'title': video_title,
195 'description': video_description,
196 'upload_date': video_date,
197 'thumbnail': video_thumbnail,
198 'url': playerdata_url,