1 from .common
import InfoExtractor
2 from ..utils
import int_or_none
5 class HarpodeonIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:www\.)?harpodeon\.com/(?:video|preview)/\w+/(?P<id>\d+)'
8 'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Bella_Butts/268068288',
9 'md5': '727371564a6a9ebccef2073535b5b6bd',
10 'skip': 'Free video could become unavailable',
14 'title': 'The Smoking Out of Bella Butts',
15 'description': 'md5:47e16bdb41fc8a79c83ab83af11c8b77',
16 'creator': 'Vitagraph Company of America',
20 'url': 'https://www.harpodeon.com/preview/The_Smoking_Out_of_Bella_Butts/268068288',
21 'md5': '6dfea5412845f690c7331be703f884db',
25 'title': 'The Smoking Out of Bella Butts',
26 'description': 'md5:47e16bdb41fc8a79c83ab83af11c8b77',
27 'creator': 'Vitagraph Company of America',
31 'url': 'https://www.harpodeon.com/preview/Behind_the_Screen/421838710',
32 'md5': '7979df9ca04637282cb7d172ab3a9c3b',
36 'title': 'Behind the Screen',
37 'description': 'md5:008972a3dc51fba3965ee517d2ba9155',
38 'creator': 'Lone Star Corporation',
43 def _real_extract(self
, url
):
44 video_id
= self
._match
_id
(url
)
45 webpage
= self
._download
_webpage
(url
, video_id
)
47 title
, creator
, release_year
= self
._search
_regex
(
49 <div[^>]+videoInfo[^<]*<h2[^>]*>(?P<title>[^>]+)</h2>
50 (?:\s*<p[^>]*>\((?P<creator>.+),\s*)?(?P<release_year>\d{4})?''',
51 webpage
, 'title', group
=('title', 'creator', 'release_year'),
52 fatal
=False) or (None, None, None)
54 hp_base
= self
._html
_search
_regex
(r
'hpBase\(\s*["\']([^
"\']+)', webpage, 'hp_base')
56 hp_inject_video, hp_resolution = self._search_regex(
58 hpInjectVideo\([\'\"](?P<hp_inject_video>\w+)[\'\"],
59 [\'\"](?P<hp_resolution>\d+)[\'\"]''',
60 webpage, 'hp_inject_video', group=['hp_inject_video', 'hp_resolution'])
65 'url': f'{hp_base}{hp_inject_video}_{hp_resolution}.mp4',
66 'http_headers': {'Referer': url},
67 'description': self._html_search_meta('description', webpage, fatal=False),
69 'release_year': int_or_none(release_year),