1 from __future__ import unicode_literals
5 from .common import InfoExtractor
12 class ParliamentLiveUKIE(InfoExtractor):
13 IE_NAME = 'parliamentlive.tv'
14 IE_DESC = 'UK parliament videos'
15 _VALID_URL = r'https?://www\.parliamentlive\.tv/Main/Player\.aspx\?(?:[^&]+&)*?meetingId=(?P<id>[0-9]+)'
18 'url': 'http://www.parliamentlive.tv/Main/Player.aspx?meetingId=15121&player=windowsmedia',
22 'title': 'hoc home affairs committee, 18 mar 2014.pm',
23 'description': 'md5:033b3acdf83304cd43946b2d5e5798d1',
26 'skip_download': True, # Requires mplayer (mms)
30 def _real_extract(self, url):
31 mobj = re.match(self._VALID_URL, url)
32 video_id = mobj.group('id')
33 webpage = self._download_webpage(url, video_id)
35 asx_url = self._html_search_regex(
36 r'embed.*?src="([^"]+)" name="MediaPlayer"', webpage,
38 asx = self._download_xml(asx_url, video_id, 'Downloading ASX metadata')
39 video_url = asx.find('.//REF').attrib['HREF']
41 title = self._search_regex(
42 r'''(?x)player\.setClipDetails\(
43 (?:(?:[0-9]+|"[^"]+"),\s*){2}
46 webpage, 'title').replace('", "', ', ')
47 description = self._html_search_regex(
48 r'(?s)<span id="MainContentPlaceHolder_CaptionsBlock_WitnessInfo">(.*?)</span>',
49 webpage, 'description')
56 'description': description,