1 from .common
import InfoExtractor
2 from ..compat
import compat_urlparse
11 class KarriereVideosIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?karrierevideos\.at(?:/[^/]+)+/(?P<id>[^/]+)'
14 'url': 'http://www.karrierevideos.at/berufsvideos/mittlere-hoehere-schulen/altenpflegerin',
18 'title': 'AltenpflegerIn',
19 'description': 'md5:dbadd1259fde2159a9b28667cb664ae2',
20 'thumbnail': r
're:^http://.*\.png',
24 'skip_download': True,
28 'url': 'http://www.karrierevideos.at/orientierung/vaeterkarenz-und-neue-chancen-fuer-muetter-baby-was-nun',
32 'title': 'Väterkarenz und neue Chancen für Mütter - "Baby - was nun?"',
33 'description': 'md5:97092c6ad1fd7d38e9d6a5fdeb2bcc33',
34 'thumbnail': r
're:^http://.*\.png',
38 'skip_download': True,
42 def _real_extract(self
, url
):
43 video_id
= self
._match
_id
(url
)
45 webpage
= self
._download
_webpage
(url
, video_id
)
47 title
= (self
._html
_search
_meta
('title', webpage
, default
=None)
48 or self
._search
_regex
(r
'<h1 class="title">([^<]+)</h1>', webpage
, 'video title'))
50 video_id
= self
._search
_regex
(
51 r
'/config/video/(.+?)\.xml', webpage
, 'video id')
52 # Server returns malformed headers
53 # Force Accept-Encoding: * to prevent gzipped results
54 playlist
= self
._download
_xml
(
55 'http://www.karrierevideos.at/player-playlist.xml.php?p=%s' % video_id
,
56 video_id
, transform_source
=fix_xml_ampersands
,
57 headers
={'Accept-Encoding': '*'})
60 'jwplayer': 'http://developer.longtailvideo.com/trac/wiki/FlashFormats'
64 return xpath_with_ns(path
, NS_MAP
)
66 item
= playlist
.find('./tracklist/item')
67 video_file
= xpath_text(
68 item
, ns('./jwplayer:file'), 'video url', fatal
=True)
69 streamer
= xpath_text(
70 item
, ns('./jwplayer:streamer'), 'streamer', fatal
=True)
72 uploader
= xpath_text(
73 item
, ns('./jwplayer:author'), 'uploader')
74 duration
= float_or_none(
75 xpath_text(item
, ns('./jwplayer:duration'), 'duration'))
77 description
= self
._html
_search
_regex
(
78 r
'(?s)<div class="leadtext">(.+?)</div>',
79 webpage
, 'description')
81 thumbnail
= self
._html
_search
_meta
(
82 'thumbnail', webpage
, 'thumbnail')
84 thumbnail
= compat_urlparse
.urljoin(url
, thumbnail
)
88 'url': streamer
.replace('rtmpt', 'rtmp'),
89 'play_path': 'mp4:%s' % video_file
,
92 'description': description
,
93 'thumbnail': thumbnail
,