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': '3aa16e4f6860e6e78b7df5829519aed3',
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,
20 'thumbnail': 'https://cdn.jwplayer.com/v2/media/nPripu9l/poster.jpg?width=720',
23 'url': 'https://cdn.jwplayer.com/players/nPripu9l-ALJ3XQCI.js',
24 'only_matching': True,
29 'url': 'https://www.covermagazine.co.uk/feature/2465255/business-protection-involved',
33 'upload_date': '20160719',
34 'timestamp': 1468923808,
35 'title': '2016_05_18 Cover L&G Business Protection V1 FINAL.mp4',
36 'thumbnail': 'https://cdn.jwplayer.com/v2/media/AG26UQXM/poster.jpg?width=720',
41 # Player url not surrounded by quotes
42 'url': 'https://www.deutsche-kinemathek.de/en/online/streaming/school-trip',
45 'title': 'Klassenfahrt',
47 'upload_date': '20230109',
48 'thumbnail': 'https://cdn.jwplayer.com/v2/media/jUxh5uin/poster.jpg?width=720',
49 'timestamp': 1673270298,
53 'params': {'allowed_extractors': ['generic', 'jwplatform']},
55 # iframe src attribute includes backslash before URL string
56 'url': 'https://www.elespectador.com/colombia/video-asi-se-evito-la-fuga-de-john-poulos-presunto-feminicida-de-valentina-trespalacios-explicacion',
59 'title': 'Asà se evitó la fuga de John Poulos, presunto feminicida de Valentina Trespalacios',
61 'upload_date': '20230127',
62 'thumbnail': 'https://cdn.jwplayer.com/v2/media/QD3gsexj/poster.jpg?width=720',
63 'timestamp': 1674862986,
64 'description': 'md5:128fd74591c4e1fc2da598c5cb6f5ce4',
70 def _extract_embed_urls(cls
, url
, webpage
):
71 for tag
, key
in ((r
'(?:script|iframe)', 'src'), ('input', 'value')):
72 # <input value=URL> is used by hyland.com
73 # if we find <iframe>, dont look for <input>
75 rf
'<{tag}[^>]+?{key}=\\?["\']?((?:https?:)?//(?:content\.jwplatform|cdn\.jwplayer)\.com/players/[a-zA-Z0-9]{{8}})',
79 mobj
= re
.search(r
'<div\b[^>]* data-video-jw-id="([a-zA-Z0-9]{8})"', webpage
)
81 return [f
'jwplatform:{mobj.group(1)}']
83 def _real_extract(self
, url
):
84 url
, smuggled_data
= unsmuggle_url(url
, {})
85 self
._initialize
_geo
_bypass
({
86 'countries': smuggled_data
.get('geo_countries'),
88 video_id
= self
._match
_id
(url
)
89 json_data
= self
._download
_json
('https://cdn.jwplayer.com/v2/media/' + video_id
, video_id
)
90 return self
._parse
_jwplayer
_data
(json_data
, video_id
)