]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/helsinki.py
1 # -*- coding: utf-8 -*-
3 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from ..utils
import js_to_json
9 class HelsinkiIE(InfoExtractor
):
10 IE_DESC
= 'helsinki.fi'
11 _VALID_URL
= r
'https?://video\.helsinki\.fi/Arkisto/flash\.php\?id=(?P<id>\d+)'
13 'url': 'http://video.helsinki.fi/Arkisto/flash.php?id=20258',
17 'title': 'Tietotekniikkafoorumi-iltapäivä',
18 'description': 'md5:f5c904224d43c133225130fe156a5ee0',
21 'skip_download': True, # RTMP
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
27 webpage
= self
._download
_webpage
(url
, video_id
)
29 params
= self
._parse
_json
(self
._html
_search
_regex
(
30 r
'(?s)jwplayer\("player"\).setup\((\{.*?\})\);',
31 webpage
, 'player code'), video_id
, transform_source
=js_to_json
)
35 } for s
in params
['sources']]
36 self
._sort
_formats
(formats
)
40 'title': self
._og
_search
_title
(webpage
).replace('Video: ', ''),
41 'description': self
._og
_search
_description
(webpage
),