1 from .common
import InfoExtractor
2 from ..utils
import parse_duration
5 class HistoricFilmsIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?historicfilms\.com/(?:tapes/|play)(?P<id>\d+)'
8 'url': 'http://www.historicfilms.com/tapes/4728',
9 'md5': 'd4a437aec45d8d796a38a215db064e9a',
13 'title': 'Historic Films: GP-7',
14 'description': 'md5:1a86a0f3ac54024e419aba97210d959a',
15 'thumbnail': r
're:^https?://.*\.jpg$',
20 def _real_extract(self
, url
):
21 video_id
= self
._match
_id
(url
)
23 webpage
= self
._download
_webpage
(url
, video_id
)
25 tape_id
= self
._search
_regex
(
26 [r
'class="tapeId"[^>]*>([^<]+)<', r
'tapeId\s*:\s*"([^"]+)"'],
29 title
= self
._og
_search
_title
(webpage
)
30 description
= self
._og
_search
_description
(webpage
)
31 thumbnail
= self
._html
_search
_meta
(
32 'thumbnailUrl', webpage
, 'thumbnails') or self
._og
_search
_thumbnail
(webpage
)
33 duration
= parse_duration(self
._html
_search
_meta
(
34 'duration', webpage
, 'duration'))
36 video_url
= f
'http://www.historicfilms.com/video/{tape_id}_{video_id}_web.mov'
42 'description': description
,
43 'thumbnail': thumbnail
,