]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ard.py
b88f71bc40b9803fb4ed0dea134738a7e1e07201
2 from __future__
import unicode_literals
6 from . common
import InfoExtractor
13 class ARDIE ( InfoExtractor
):
14 _VALID_URL
= r
'^https?://(?:(?:www\.)?ardmediathek\.de|mediathek\.daserste\.de)/(?:.*/)(?P<video_id>[^/\?]+)(?:\?.*)?'
17 'url' : 'http://www.ardmediathek.de/das-erste/guenther-jauch/edward-snowden-im-interview-held-oder-verraeter?documentId=19288786' ,
18 'file' : '19288786.mp4' ,
19 'md5' : '515bf47ce209fb3f5a61b7aad364634c' ,
21 'title' : 'Edward Snowden im Interview - Held oder Verräter?' ,
22 'description' : 'Edward Snowden hat alles aufs Spiel gesetzt, um die weltweite \xdc berwachung durch die Geheimdienste zu enttarnen. Nun stellt sich der ehemalige NSA-Mitarbeiter erstmals weltweit in einem TV-Interview den Fragen eines NDR-Journalisten. Die Sendung vom Sonntagabend.' ,
23 'thumbnail' : 'http://www.ardmediathek.de/ard/servlet/contentblob/19/28/87/90/19288790/bild/2250037' ,
25 'skip' : 'Blocked outside of Germany' ,
28 def _real_extract ( self
, url
):
29 # determine video id from url
30 m
= re
. match ( self
._ VALID
_U RL
, url
)
32 numid
= re
. search ( r
'documentId=([0-9]+)' , url
)
34 video_id
= numid
. group ( 1 )
36 video_id
= m
. group ( 'video_id' )
38 webpage
= self
._ download
_ webpage
( url
, video_id
)
40 title
= self
._ html
_ search
_ regex
(
41 r
'<h1(?:\s+class="boxTopHeadline")?>(.*?)</h1>' , webpage
, 'title' )
42 description
= self
._ html
_ search
_ meta
(
43 'dcterms.abstract' , webpage
, 'description' )
44 thumbnail
= self
._ og
_ search
_ thumbnail
( webpage
)
48 for mo
in re
. finditer (
49 r
'mediaCollection\.addMediaStream\((?P<media_type>\d+), (?P<quality>\d+), "(?P<rtmp_url>[^"]*)", "(?P<video_url>[^"]*)", "[^"]*"\)' , webpage
)]
51 if '"fsk"' in webpage
:
52 raise ExtractorError ( 'This video is only available after 20:00' )
57 'quality' : int ( s
[ 'quality' ]),
60 format
[ 'protocol' ] = 'rtmp'
61 format
[ 'url' ] = s
[ 'rtmp_url' ]
62 format
[ 'playpath' ] = s
[ 'video_url' ]
64 format
[ 'url' ] = s
[ 'video_url' ]
66 quality_name
= self
._ search
_ regex
(
67 r
'[,.]([a-zA-Z0-9_-]+),?\.mp4' , format
[ 'url' ],
68 'quality name' , default
= 'NA' )
69 format
[ 'format_id' ] = ' %s-%s-%s-%s ' % (
70 determine_ext ( format
[ 'url' ]), quality_name
, s
[ 'media_type' ],
73 formats
. append ( format
)
75 self
._ sort
_ formats
( formats
)
80 'description' : description
,
82 'thumbnail' : thumbnail
,