]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/walla.py
2 from __future__
import unicode_literals
6 from .subtitles
import SubtitlesInfoExtractor
13 class WallaIE(SubtitlesInfoExtractor
):
14 _VALID_URL
= r
'http://vod\.walla\.co\.il/[^/]+/(?P<id>\d+)/(?P<display_id>.+)'
16 'url': 'http://vod.walla.co.il/movie/2642630/one-direction-all-for-one',
19 'display_id': 'one-direction-all-for-one',
21 'title': 'וואן דיירקשן: ההיסטריה',
22 'description': 'md5:de9e2512a92442574cdb0913c49bc4d8',
23 'thumbnail': 're:^https?://.*\.jpg',
28 'skip_download': True,
36 def _real_extract(self
, url
):
37 mobj
= re
.match(self
._VALID
_URL
, url
)
38 video_id
= mobj
.group('id')
39 display_id
= mobj
.group('display_id')
41 video
= self
._download
_xml
(
42 'http://video2.walla.co.il/?w=null/null/%s/@@/video/flv_pl' % video_id
,
45 item
= video
.find('./items/item')
47 title
= xpath_text(item
, './title', 'title')
48 description
= xpath_text(item
, './synopsis', 'description')
49 thumbnail
= xpath_text(item
, './preview_pic', 'thumbnail')
50 duration
= int_or_none(xpath_text(item
, './duration', 'duration'))
53 for subtitle
in item
.findall('./subtitles/subtitle'):
54 lang
= xpath_text(subtitle
, './title')
55 subtitles
[self
._SUBTITLE
_LANGS
.get(lang
, lang
)] = xpath_text(subtitle
, './src')
57 if self
._downloader
.params
.get('listsubtitles', False):
58 self
._list
_available
_subtitles
(video_id
, subtitles
)
61 subtitles
= self
.extract_subtitles(video_id
, subtitles
)
64 for quality
in item
.findall('./qualities/quality'):
65 format_id
= xpath_text(quality
, './title')
67 'url': 'rtmp://wafla.walla.co.il/vod',
68 'play_path': xpath_text(quality
, './src'),
69 'player_url': 'http://isc.walla.co.il/w9/swf/video_swf/vod/WallaMediaPlayerAvod.swf',
72 'format_id': xpath_text(quality
, './title'),
74 m
= re
.search(r
'^(?P<height>\d+)[Pp]', format_id
)
76 fmt
['height'] = int(m
.group('height'))
78 self
._sort
_formats
(formats
)
82 'display_id': display_id
,
84 'description': description
,
85 'thumbnail': thumbnail
,
88 'subtitles': subtitles
,