[generic] parse jwplayer with only the json URL

Closes #1476
This commit is contained in:
pukkandan 2021-10-30 01:53:28 +05:30
parent 10beccc980
commit 5e7bbac305
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698

View File

@ -1188,6 +1188,21 @@ class GenericIE(InfoExtractor):
},
'skip': 'Only has video a few mornings per month, see http://www.suffolk.edu/sjc/',
},
# jwplayer with only the json URL
{
'url': 'https://www.hollywoodreporter.com/news/general-news/dunkirk-team-reveals-what-christopher-nolan-said-oscar-win-meet-your-oscar-winner-1092454',
'info_dict': {
'id': 'TljWkvWH',
'ext': 'mp4',
'upload_date': '20180306',
'title': 'md5:91eb1862f6526415214f62c00b453936',
'description': 'md5:73048ae50ae953da10549d1d2fe9b3aa',
'timestamp': 1520367225,
},
'params': {
'skip_download': True,
},
},
# Complex jwplayer
{
'url': 'http://www.indiedb.com/games/king-machine/videos',
@ -3503,6 +3518,13 @@ def _real_extract(self, url):
jwplayer_data = self._find_jwplayer_data(
webpage, video_id, transform_source=js_to_json)
if jwplayer_data:
if isinstance(jwplayer_data.get('playlist'), str):
return {
**info_dict,
'_type': 'url',
'ie_key': JWPlatformIE.ie_key(),
'url': jwplayer_data['playlist'],
}
try:
info = self._parse_jwplayer_data(
jwplayer_data, video_id, require_title=False, base_url=url)