3 from .common
import InfoExtractor
4 from ..utils
import int_or_none
7 class PopcorntimesIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://popcorntimes\.tv/[^/]+/m/(?P<id>[^/]+)/(?P<display_id>[^/?#&]+)'
10 'url': 'https://popcorntimes.tv/de/m/A1XCFvz/haensel-und-gretel-opera-fantasy',
11 'md5': '93f210991ad94ba8c3485950a2453257',
14 'display_id': 'haensel-und-gretel-opera-fantasy',
16 'title': 'Hänsel und Gretel',
17 'description': 'md5:1b8146791726342e7b22ce8125cf6945',
18 'thumbnail': r
're:^https?://.*\.jpg$',
19 'creator': 'John Paul',
20 'release_date': '19541009',
28 def _real_extract(self
, url
):
29 mobj
= self
._match
_valid
_url
(url
)
30 video_id
, display_id
= mobj
.group('id', 'display_id')
32 webpage
= self
._download
_webpage
(url
, display_id
)
34 title
= self
._search
_regex
(
35 r
'<h1>([^<]+)', webpage
, 'title',
36 default
=None) or self
._html
_search
_meta
(
37 'ya:ovs:original_name', webpage
, 'title', fatal
=True)
39 loc
= self
._search
_regex
(
40 r
'PCTMLOC\s*=\s*(["\'])(?P
<value
>(?
:(?
!\
1).)+)\
1', webpage, 'loc
',
46 if ord('a
') <= c_ord <= ord('z
') or ord('A
') <= c_ord <= ord('Z
'):
47 upper = ord('Z
') if c_ord <= ord('Z
') else ord('z
')
53 video_url = base64.b64decode(loc_b64).decode('utf
-8')
55 description = self._html_search_regex(
56 r'(?s
)<div
[^
>]+class=["\']pt-movie-desc[^>]+>(.+?)</div>', webpage,
57 'description', fatal=False)
59 thumbnail = self._search_regex(
60 r'<img[^>]+class=["\']video
-preview
[^
>]+\bsrc
=(["\'])(?P<value>(?:(?!\1).)+)\1',
61 webpage, 'thumbnail', default=None,
62 group='value') or self._og_search_thumbnail(webpage)
64 creator = self._html_search_meta(
65 'video:director', webpage, 'creator', default=None)
67 release_date = self._html_search_meta(
68 'video:release_date', webpage, default=None)
70 release_date = release_date.replace('-', '')
73 return int_or_none(self._html_search_meta(
74 name, webpage, default=None))
78 'display_id': display_id,
81 'description': description,
82 'thumbnail': thumbnail,
84 'release_date': release_date,
85 'duration': int_meta('video:duration'),
86 'tbr': int_meta('ya:ovs:bitrate'),
87 'width': int_meta('og:video:width'),
88 'height': int_meta('og:video:height'),