1 from .common
import InfoExtractor
2 from ..compat
import compat_b64decode
3 from ..utils
import int_or_none
6 class PopcorntimesIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://popcorntimes\.tv/[^/]+/m/(?P<id>[^/]+)/(?P<display_id>[^/?#&]+)'
9 'url': 'https://popcorntimes.tv/de/m/A1XCFvz/haensel-und-gretel-opera-fantasy',
10 'md5': '93f210991ad94ba8c3485950a2453257',
13 'display_id': 'haensel-und-gretel-opera-fantasy',
15 'title': 'Hänsel und Gretel',
16 'description': 'md5:1b8146791726342e7b22ce8125cf6945',
17 'thumbnail': r
're:^https?://.*\.jpg$',
18 'creator': 'John Paul',
19 'release_date': '19541009',
27 def _real_extract(self
, url
):
28 mobj
= self
._match
_valid
_url
(url
)
29 video_id
, display_id
= mobj
.group('id', 'display_id')
31 webpage
= self
._download
_webpage
(url
, display_id
)
33 title
= self
._search
_regex
(
34 r
'<h1>([^<]+)', webpage
, 'title',
35 default
=None) or self
._html
_search
_meta
(
36 'ya:ovs:original_name', webpage
, 'title', fatal
=True)
38 loc
= self
._search
_regex
(
39 r
'PCTMLOC\s*=\s*(["\'])(?P
<value
>(?
:(?
!\
1).)+)\
1', webpage, 'loc
',
45 if ord('a
') <= c_ord <= ord('z
') or ord('A
') <= c_ord <= ord('Z
'):
46 upper = ord('Z
') if c_ord <= ord('Z
') else ord('z
')
52 video_url = compat_b64decode(loc_b64).decode('utf
-8')
54 description = self._html_search_regex(
55 r'(?s
)<div
[^
>]+class=["\']pt-movie-desc[^>]+>(.+?)</div>', webpage,
56 'description', fatal=False)
58 thumbnail = self._search_regex(
59 r'<img[^>]+class=["\']video
-preview
[^
>]+\bsrc
=(["\'])(?P<value>(?:(?!\1).)+)\1',
60 webpage, 'thumbnail', default=None,
61 group='value') or self._og_search_thumbnail(webpage)
63 creator = self._html_search_meta(
64 'video:director', webpage, 'creator', default=None)
66 release_date = self._html_search_meta(
67 'video:release_date', webpage, default=None)
69 release_date = release_date.replace('-', '')
72 return int_or_none(self._html_search_meta(
73 name, webpage, default=None))
77 'display_id': display_id,
80 'description': description,
81 'thumbnail': thumbnail,
83 'release_date': release_date,
84 'duration': int_meta('video:duration'),
85 'tbr': int_meta('ya:ovs:bitrate'),
86 'width': int_meta('og:video:width'),
87 'height': int_meta('og:video:height'),