]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dreisat.py
5 from . common
import InfoExtractor
11 class DreiSatIE ( InfoExtractor
):
13 _VALID_URL
= r
'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php)?\?(?:(?:mode|display)=[^&]+&)*obj=(?P<id>[0-9]+)$'
15 u
"url" : u
"http://www.3sat.de/mediathek/index.php?obj=36983" ,
16 u
'file' : u
'36983.mp4' ,
17 u
'md5' : u
'9dcfe344732808dbfcc901537973c922' ,
19 u
"title" : u
"Kaffeeland Schweiz" ,
20 u
"description" : u
"Über 80 Kaffeeröstereien liefern in der Schweiz das Getränk, in das das Land so vernarrt ist: Mehr als 1000 Tassen trinkt ein Schweizer pro Jahr. SCHWEIZWEIT nimmt die Kaffeekultur unter die..." ,
22 u
"upload_date" : u
"20130622"
27 def _real_extract ( self
, url
):
28 mobj
= re
. match ( self
._ VALID
_U RL
, url
)
29 video_id
= mobj
. group ( 'id' )
30 details_url
= 'http://www.3sat.de/mediathek/xmlservice/web/beitragsDetails?ak=web&id= %s ' % video_id
31 details_doc
= self
._ download
_ xml
( details_url
, video_id
, note
= u
'Downloading video details' )
33 thumbnail_els
= details_doc
. findall ( './/teaserimage' )
35 'width' : te
. attrib
[ 'key' ]. partition ( 'x' )[ 0 ],
36 'height' : te
. attrib
[ 'key' ]. partition ( 'x' )[ 2 ],
38 } for te
in thumbnail_els
]
40 information_el
= details_doc
. find ( './/information' )
41 video_title
= information_el
. find ( './title' ). text
42 video_description
= information_el
. find ( './detail' ). text
44 details_el
= details_doc
. find ( './/details' )
45 video_uploader
= details_el
. find ( './channel' ). text
46 upload_date
= unified_strdate ( details_el
. find ( './airtime' ). text
)
48 format_els
= details_doc
. findall ( './/formitaet' )
50 'format_id' : fe
. attrib
[ 'basetype' ],
51 'width' : int ( fe
. find ( './width' ). text
),
52 'height' : int ( fe
. find ( './height' ). text
),
53 'url' : fe
. find ( './url' ). text
,
54 'filesize' : int ( fe
. find ( './filesize' ). text
),
55 'video_bitrate' : int ( fe
. find ( './videoBitrate' ). text
),
56 } for fe
in format_els
57 if not fe
. find ( './url' ). text
. startswith ( 'http://www.metafilegenerator.de/' )]
59 self
._ sort
_ formats
( formats
)
66 'description' : video_description
,
67 'thumbnails' : thumbnails
,
68 'thumbnail' : thumbnails
[- 1 ][ 'url' ],
69 'uploader' : video_uploader
,
70 'upload_date' : upload_date
,