2 from __future__ import unicode_literals
6 from .common import InfoExtractor
14 class ScreenwaveMediaIE(InfoExtractor):
15 _VALID_URL = r'http://player\d?\.screenwavemedia\.com/(?:play/)?[a-zA-Z]+\.php\?[^"]*\bid=(?P<id>.+)'
18 'url': 'http://player.screenwavemedia.com/play/play.php?playerdiv=videoarea&companiondiv=squareAd&id=Cinemassacre-19911',
19 'only_matching': True,
22 def _real_extract(self, url):
23 video_id = self._match_id(url)
25 playerdata = self._download_webpage(
26 'http://player.screenwavemedia.com/player.php?id=%s' % video_id,
27 video_id, 'Downloading player webpage')
29 vidtitle = self._search_regex(
30 r'\'vidtitle\'\s*:\s*"([^"]+)"', playerdata, 'vidtitle').replace('\\/', '/')
32 playerconfig = self._download_webpage(
33 'http://player.screenwavemedia.com/player.js',
34 video_id, 'Downloading playerconfig webpage')
36 videoserver = self._search_regex(r"\[ipaddress\]\s*=>\s*([\d\.]+)", playerdata, 'videoserver')
38 sources = self._parse_json(
43 r"sources\s*:\s*(\[[^\]]+?\])", playerconfig,
46 "' + thisObj.options.videoserver + '",
49 "' + playerVidId + '",
58 for source in sources:
59 if source['type'] == 'hls':
60 formats.extend(self._extract_m3u8_formats(source['file'], video_id))
62 format_label = source.get('label')
63 height = int_or_none(self._search_regex(
64 r'^(\d+)[pP]', format_label, 'height', default=None))
66 'url': source['file'],
67 'format': format_label,
68 'ext': source.get('type'),
71 self._sort_formats(formats)
80 class TeamFourIE(InfoExtractor):
81 _VALID_URL = r'https?://(?:www\.)?teamfourstar\.com/video/(?P<id>[a-z0-9\-]+)/?'
83 'url': 'http://teamfourstar.com/video/a-moment-with-tfs-episode-4/',
85 'id': 'TeamFourStar-5292a02f20bfa',
87 'upload_date': '20130401',
88 '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',
89 'title': 'A Moment With TFS Episode 4',
93 def _real_extract(self, url):
94 display_id = self._match_id(url)
95 webpage = self._download_webpage(url, display_id)
97 playerdata_url = self._search_regex(
98 r'src="(http://player\d?\.screenwavemedia\.com/(?:play/)?[a-zA-Z]+\.php\?[^"]*\bid=.+?)"',
99 webpage, 'player data URL')
101 video_title = self._html_search_regex(
102 r'<div class="heroheadingtitle">(?P<title>.+?)</div>',
104 video_date = unified_strdate(self._html_search_regex(
105 r'<div class="heroheadingdate">(?P<date>.+?)</div>',
106 webpage, 'date', fatal=False))
107 video_description = self._html_search_regex(
108 r'(?s)<div class="postcontent">(?P<description>.+?)</div>',
109 webpage, 'description', fatal=False)
110 video_thumbnail = self._og_search_thumbnail(webpage)
113 '_type': 'url_transparent',
114 'display_id': display_id,
115 'title': video_title,
116 'description': video_description,
117 'upload_date': video_date,
118 'thumbnail': video_thumbnail,
119 'url': playerdata_url,