3 from .common
import InfoExtractor
12 class FolketingetIE(InfoExtractor
):
13 IE_DESC
= 'Folketinget (ft.dk; Danish parliament)'
14 _VALID_URL
= r
'https?://(?:www\.)?ft\.dk/webtv/video/[^?#]*?\.(?P<id>[0-9]+)\.aspx'
16 'url': 'http://www.ft.dk/webtv/video/20141/eru/td.1165642.aspx?as=1#player',
17 'md5': '6269e8626fa1a891bf5369b386ae996a',
21 'title': 'Åbent samråd i Erhvervsudvalget',
22 'description': 'Åbent samråd med erhvervs- og vækstministeren om regeringens politik på teleområdet',
27 'timestamp': 1416493800,
28 'upload_date': '20141120',
33 'skip_download': True,
37 def _real_extract(self
, url
):
38 video_id
= self
._match
_id
(url
)
39 webpage
= self
._download
_webpage
(url
, video_id
)
41 title
= self
._og
_search
_title
(webpage
)
42 description
= self
._html
_search
_regex
(
43 r
'(?s)<div class="video-item-agenda"[^>]*>(.*?)<',
44 webpage
, 'description', fatal
=False)
46 player_params
= urllib
.parse
.parse_qs(self
._search
_regex
(
47 r
'<embed src="http://ft\.arkena\.tv/flash/ftplayer\.swf\?([^"]+)"',
48 webpage
, 'player params'))
49 xml_url
= player_params
['xml'][0]
50 doc
= self
._download
_xml
(xml_url
, video_id
)
52 timestamp
= parse_iso8601(xpath_text(doc
, './/date'))
53 duration
= parse_duration(xpath_text(doc
, './/duration'))
54 width
= int_or_none(xpath_text(doc
, './/width'))
55 height
= int_or_none(xpath_text(doc
, './/height'))
56 view_count
= int_or_none(xpath_text(doc
, './/views'))
59 'format_id': n
.attrib
['bitrate'],
60 'url': xpath_text(n
, './url', fatal
=True),
61 'tbr': int_or_none(n
.attrib
['bitrate']),
62 } for n
in doc
.findall('.//streams/stream')]
68 'description': description
,
69 'timestamp': timestamp
,
73 'view_count': view_count
,