]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/myspass.py
2 from __future__
import unicode_literals
6 from . common
import InfoExtractor
7 from .. compat
import compat_str
15 class MySpassIE ( InfoExtractor
):
16 _VALID_URL
= r
'https?://(?:www\.)?myspass\.de/([^/]+/)*(?P<id>\d+)'
18 'url' : 'http://www.myspass.de/myspass/shows/tvshows/absolute-mehrheit/Absolute-Mehrheit-vom-17022013-Die-Highlights-Teil-2--/11741/' ,
19 'md5' : '0b49f4844a068f8b33f4b7c88405862b' ,
23 'description' : 'Wer kann in die Fußstapfen von Wolfgang Kubicki treten und die Mehrheit der Zuschauer hinter sich versammeln? Wird vielleicht sogar die Absolute Mehrheit geknackt und der Jackpot von 200.000 Euro mit nach Hause genommen?' ,
24 'title' : '17.02.2013 - Die Highlights, Teil 2' ,
28 def _real_extract ( self
, url
):
29 video_id
= self
._ match
_ id
( url
)
31 metadata
= self
._ download
_ xml
(
32 'http://www.myspass.de/myspass/includes/apps/video/getvideometadataxml.php?id=' + video_id
,
35 title
= xpath_text ( metadata
, 'title' , fatal
= True )
36 video_url
= xpath_text ( metadata
, 'url_flv' , 'download url' , True )
37 video_id_int
= int ( video_id
)
38 for group
in re
. search ( r
'/myspass2009/\d+/(\d+)/(\d+)/(\d+)/' , video_url
). groups ():
39 group_int
= int ( group
)
40 if group_int
> video_id_int
:
41 video_url
= video_url
. replace (
42 group
, compat_str ( group_int
// video_id_int
))
48 'thumbnail' : xpath_text ( metadata
, 'imagePreview' ),
49 'description' : xpath_text ( metadata
, 'description' ),
50 'duration' : parse_duration ( xpath_text ( metadata
, 'duration' )),
51 'series' : xpath_text ( metadata
, 'format' ),
52 'season_number' : int_or_none ( xpath_text ( metadata
, 'season' )),
53 'season_id' : xpath_text ( metadata
, 'season_id' ),
55 'episode_number' : int_or_none ( xpath_text ( metadata
, 'episode' )),