3 from .common
import InfoExtractor
4 from ..utils
import unsmuggle_url
7 class JWPlatformIE(InfoExtractor
):
8 _VALID_URL
= r
'(?:https?://(?:content\.jwplatform|cdn\.jwplayer)\.com/(?:(?:feed|player|thumb|preview|manifest)s|jw6|v2/media)/|jwplatform:)(?P<id>[a-zA-Z0-9]{8})'
10 'url': 'http://content.jwplatform.com/players/nPripu9l-ALJ3XQCI.js',
11 'md5': 'fa8899fa601eb7c83a64e9d568bdf325',
15 'title': 'Big Buck Bunny Trailer',
16 'description': 'Big Buck Bunny is a short animated film by the Blender Institute. It is made using free and open source software.',
17 'upload_date': '20081127',
18 'timestamp': 1227796140,
21 'url': 'https://cdn.jwplayer.com/players/nPripu9l-ALJ3XQCI.js',
22 'only_matching': True,
27 'url': 'https://www.covermagazine.co.uk/feature/2465255/business-protection-involved',
31 'upload_date': '20160719',
32 'timestamp': 1468923808,
33 'title': '2016_05_18 Cover L&G Business Protection V1 FINAL.mp4',
34 'thumbnail': 'https://cdn.jwplayer.com/v2/media/AG26UQXM/poster.jpg?width=720',
39 # Player url not surrounded by quotes
40 'url': 'https://www.deutsche-kinemathek.de/en/online/streaming/darling-berlin',
45 'upload_date': '20220624',
46 'thumbnail': 'https://cdn.jwplayer.com/v2/media/R10NQdhY/poster.jpg?width=720',
47 'timestamp': 1656064800,
48 'description': 'BRD 1966, Will Tremper',
51 'params': {'allowed_extractors': ['generic', 'jwplatform']}
,
55 def _extract_embed_urls(cls
, url
, webpage
):
56 for tag
, key
in ((r
'(?:script|iframe)', 'src'), ('input', 'value')):
57 # <input value=URL> is used by hyland.com
58 # if we find <iframe>, dont look for <input>
60 r
'<%s[^>]+?%s=["\']?
((?
:https?
:)?
//(?
:content\
.jwplatform|cdn\
.jwplayer
)\
.com
/players
/[a
-zA
-Z0
-9]{8}
)' % (tag, key),
64 mobj = re.search(r'<div
\b[^
>]* data
-video
-jw
-id="([a-zA-Z0-9]{8})"', webpage)
66 return [f'jwplatform
:{mobj.group(1)}
']
68 def _real_extract(self, url):
69 url, smuggled_data = unsmuggle_url(url, {})
70 self._initialize_geo_bypass({
71 'countries
': smuggled_data.get('geo_countries
'),
73 video_id = self._match_id(url)
74 json_data = self._download_json('https
://cdn
.jwplayer
.com
/v2
/media
/' + video_id, video_id)
75 return self._parse_jwplayer_data(json_data, video_id)