]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/parliamentliveuk.py
0a423a08f0dd9b746ecf708509a525b4c0bed541
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class ParliamentLiveUKIE(InfoExtractor
):
9 IE_NAME
= 'parliamentlive.tv'
10 IE_DESC
= 'UK parliament videos'
11 _VALID_URL
= r
'https?://www\.parliamentlive\.tv/Main/Player\.aspx\?(?:[^&]+&)*?meetingId=(?P<id>[0-9]+)'
14 'url': 'http://www.parliamentlive.tv/Main/Player.aspx?meetingId=15121&player=windowsmedia',
18 'title': 'hoc home affairs committee, 18 mar 2014.pm',
19 'description': 'md5:033b3acdf83304cd43946b2d5e5798d1',
22 'skip_download': True, # Requires mplayer (mms)
26 def _real_extract(self
, url
):
27 mobj
= re
.match(self
._VALID
_URL
, url
)
28 video_id
= mobj
.group('id')
29 webpage
= self
._download
_webpage
(url
, video_id
)
31 asx_url
= self
._html
_search
_regex
(
32 r
'embed.*?src="([^"]+)" name="MediaPlayer"', webpage
,
34 asx
= self
._download
_xml
(asx_url
, video_id
, 'Downloading ASX metadata')
35 video_url
= asx
.find('.//REF').attrib
['HREF']
37 title
= self
._search
_regex
(
38 r
'''(?x)player\.setClipDetails\(
39 (?:(?:[0-9]+|"[^"]+"),\s*){2}
42 webpage
, 'title').replace('", "', ', ')
43 description
= self
._html
_search
_regex
(
44 r
'(?s)<span id="MainContentPlaceHolder_CaptionsBlock_WitnessInfo">(.*?)</span>',
45 webpage
, 'description')
52 'description': description
,