]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/jwplatform.py
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)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,
26 def _extract_url(webpage
):
27 urls
= JWPlatformIE
._extract
_urls
(webpage
)
28 return urls
[0] if urls
else None
31 def _extract_urls(webpage
):
32 for tag
, key
in ((r
'(?:script|iframe)', 'src'), ('input', 'value')):
33 # <input value=URL> is used by hyland.com
34 # if we find <iframe>, dont look for <input>
36 r
'<%s[^>]+?%s=["\']((?
:https?
:)?
//(?
:content\
.jwplatform|cdn\
.jwplayer
)\
.com
/players
/[a
-zA
-Z0
-9]{8}
)' % (tag, key),
41 def _real_extract(self, url):
42 url, smuggled_data = unsmuggle_url(url, {})
43 self._initialize_geo_bypass({
44 'countries
': smuggled_data.get('geo_countries
'),
46 video_id = self._match_id(url)
47 json_data = self._download_json('https
://cdn
.jwplayer
.com
/v2
/media
/' + video_id, video_id)
48 return self._parse_jwplayer_data(json_data, video_id)