1 from __future__ import unicode_literals
3 from .common import InfoExtractor
10 class DHMIE(InfoExtractor):
11 IE_DESC = 'Filmarchiv - Deutsches Historisches Museum'
12 _VALID_URL = r'http://www\.dhm\.de/filmarchiv/die-filme/(?P<id>[^/]+)'
15 'url': 'http://www.dhm.de/filmarchiv/die-filme/the-marshallplan-at-work-in-west-germany/',
16 'md5': '11c475f670209bf6acca0b2b7ef51827',
18 'id': 'the-marshallplan-at-work-in-west-germany',
20 'title': 'MARSHALL PLAN AT WORK IN WESTERN GERMANY, THE',
21 'description': 'md5:1fabd480c153f97b07add61c44407c82',
23 'thumbnail': 're:^https?://.*\.jpg$',
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
30 webpage = self._download_webpage(url, video_id)
32 playlist_url = self._search_regex(
33 r"file\s*:\s*'([^']+)'", webpage, 'playlist url')
35 playlist = self._download_xml(playlist_url, video_id)
37 track = playlist.find(
38 './{http://xspf.org/ns/0/}trackList/{http://xspf.org/ns/0/}track')
40 video_url = xpath_text(
41 track, './{http://xspf.org/ns/0/}location',
42 'video url', fatal=True)
43 thumbnail = xpath_text(
44 track, './{http://xspf.org/ns/0/}image',
47 title = self._search_regex(
48 [r'dc:title="([^"]+)"', r'<title> »([^<]+)</title>'],
49 webpage, 'title').strip()
50 description = self._html_search_regex(
51 r'<p><strong>Description:</strong>(.+?)</p>',
52 webpage, 'description', fatal=False)
53 duration = parse_duration(self._search_regex(
54 r'<em>Length\s*</em>\s*:\s*</strong>([^<]+)',
55 webpage, 'duration', fatal=False))
61 'description': description,
63 'thumbnail': thumbnail,