]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/folketinget.py
1 # -*- coding: utf-8 -*-
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',
22 'title': 'Åbent samråd i Erhvervsudvalget',
23 'description': 'Åbent samråd med erhvervs- og vækstministeren om regeringens politik på teleområdet',
28 'timestamp': 1416493800,
29 'upload_date': '20141120',
33 'skip_download': 'rtmpdump required',
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
= compat_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')]
63 self
._sort
_formats
(formats
)
69 'description': description
,
70 'timestamp': timestamp
,
74 'view_count': view_count
,