]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/historicfilms.py
40afbe537c6eb930216afbe2afda23002151d8f2
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from ..utils
import parse_duration
7 class HistoricFilmsIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?historicfilms\.com/(?:tapes/|play)(?P<id>\d+)'
10 'url': 'http://www.historicfilms.com/tapes/4728',
11 'md5': 'd4a437aec45d8d796a38a215db064e9a',
15 'title': 'Historic Films: GP-7',
16 'description': 'md5:1a86a0f3ac54024e419aba97210d959a',
17 'thumbnail': 're:^https?://.*\.jpg$',
22 def _real_extract(self
, url
):
23 video_id
= self
._match
_id
(url
)
25 webpage
= self
._download
_webpage
(url
, video_id
)
27 tape_id
= self
._search
_regex
(
28 r
'class="tapeId">([^<]+)<', webpage
, 'tape id')
30 title
= self
._og
_search
_title
(webpage
)
31 description
= self
._og
_search
_description
(webpage
)
32 thumbnail
= self
._html
_search
_meta
(
33 'thumbnailUrl', webpage
, 'thumbnails') or self
._og
_search
_thumbnail
(webpage
)
34 duration
= parse_duration(self
._html
_search
_meta
(
35 'duration', webpage
, 'duration'))
37 video_url
= 'http://www.historicfilms.com/video/%s_%s_web.mov' % (tape_id
, video_id
)
43 'description': description
,
44 'thumbnail': thumbnail
,