]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/dhm.py
1 from .common
import InfoExtractor
2 from ..utils
import parse_duration
5 class DHMIE(InfoExtractor
):
6 IE_DESC
= 'Filmarchiv - Deutsches Historisches Museum'
7 _VALID_URL
= r
'https?://(?:www\.)?dhm\.de/filmarchiv/(?:[^/]+/)+(?P<id>[^/]+)'
10 'url': 'http://www.dhm.de/filmarchiv/die-filme/the-marshallplan-at-work-in-west-germany/',
11 'md5': '11c475f670209bf6acca0b2b7ef51827',
13 'id': 'the-marshallplan-at-work-in-west-germany',
15 'title': 'MARSHALL PLAN AT WORK IN WESTERN GERMANY, THE',
16 'description': 'md5:1fabd480c153f97b07add61c44407c82',
18 'thumbnail': r
're:^https?://.*\.jpg$',
21 'url': 'http://www.dhm.de/filmarchiv/02-mapping-the-wall/peter-g/rolle-1/',
22 'md5': '09890226332476a3e3f6f2cb74734aa5',
27 'thumbnail': r
're:^https?://.*\.jpg$',
31 def _real_extract(self
, url
):
32 playlist_id
= self
._match
_id
(url
)
34 webpage
= self
._download
_webpage
(url
, playlist_id
)
36 playlist_url
= self
._search
_regex
(
37 r
"file\s*:\s*'([^']+)'", webpage
, 'playlist url')
39 entries
= self
._extract
_xspf
_playlist
(playlist_url
, playlist_id
)
41 title
= self
._search
_regex
(
42 [r
'dc:title="([^"]+)"', r
'<title> »([^<]+)</title>'],
43 webpage
, 'title').strip()
44 description
= self
._html
_search
_regex
(
45 r
'<p><strong>Description:</strong>(.+?)</p>',
46 webpage
, 'description', default
=None)
47 duration
= parse_duration(self
._search
_regex
(
48 r
'<em>Length\s*</em>\s*:\s*</strong>([^<]+)',
49 webpage
, 'duration', default
=None))
53 'description': description
,
57 return self
.playlist_result(entries
, playlist_id
)