2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..compat import compat_parse_qs
14 class FolketingetIE(InfoExtractor):
15 IE_DESC = 'Folketinget (ft.dk; Danish parliament)'
16 _VALID_URL = r'https?://(?:www\.)?ft\.dk/webtv/video/[^?#]*?\.(?P<id>[0-9]+)\.aspx'
18 'url': 'http://www.ft.dk/webtv/video/20141/eru/td.1165642.aspx?as=1#player',
19 'md5': '6269e8626fa1a891bf5369b386ae996a',
23 'title': 'Åbent samråd i Erhvervsudvalget',
24 'description': 'Åbent samråd med erhvervs- og vækstministeren om regeringens politik på teleområdet',
29 'timestamp': 1416493800,
30 'upload_date': '20141120',
35 'skip_download': True,
39 def _real_extract(self, url):
40 video_id = self._match_id(url)
41 webpage = self._download_webpage(url, video_id)
43 title = self._og_search_title(webpage)
44 description = self._html_search_regex(
45 r'(?s)<div class="video-item-agenda"[^>]*>(.*?)<',
46 webpage, 'description', fatal=False)
48 player_params = compat_parse_qs(self._search_regex(
49 r'<embed src="http://ft\.arkena\.tv/flash/ftplayer\.swf\?([^"]+)"',
50 webpage, 'player params'))
51 xml_url = player_params['xml'][0]
52 doc = self._download_xml(xml_url, video_id)
54 timestamp = parse_iso8601(xpath_text(doc, './/date'))
55 duration = parse_duration(xpath_text(doc, './/duration'))
56 width = int_or_none(xpath_text(doc, './/width'))
57 height = int_or_none(xpath_text(doc, './/height'))
58 view_count = int_or_none(xpath_text(doc, './/views'))
61 'format_id': n.attrib['bitrate'],
62 'url': xpath_text(n, './url', fatal=True),
63 'tbr': int_or_none(n.attrib['bitrate']),
64 } for n in doc.findall('.//streams/stream')]
65 self._sort_formats(formats)
71 'description': description,
72 'timestamp': timestamp,
76 'view_count': view_count,