From 55baa67c7c7e10c4ef84f68460fa5561ab67c642 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Sun, 12 Jun 2022 03:25:55 +0530 Subject: [PATCH] [extractor/jwplatform] Look for `data-video-jw-id` Closes #3821 --- yt_dlp/extractor/generic.py | 22 +++++++++++++++++++++- yt_dlp/extractor/jwplatform.py | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py index c7e9ea059..36e82ca04 100644 --- a/yt_dlp/extractor/generic.py +++ b/yt_dlp/extractor/generic.py @@ -2542,7 +2542,27 @@ class GenericIE(InfoExtractor): 'timestamp': 1652833414, 'age_limit': 0, } - } + }, { + 'url': 'https://www.skimag.com/video/ski-people-1980/', + 'info_dict': { + 'id': 'ski-people-1980', + 'title': 'Ski People (1980)', + }, + 'playlist_count': 1, + 'playlist': [{ + 'md5': '022a7e31c70620ebec18deeab376ee03', + 'info_dict': { + 'id': 'YTmgRiNU', + 'ext': 'mp4', + 'title': '1980 Ski People', + 'timestamp': 1610407738, + 'description': 'md5:cf9c3d101452c91e141f292b19fe4843', + 'thumbnail': 'https://cdn.jwplayer.com/v2/media/YTmgRiNU/poster.jpg?width=720', + 'duration': 5688.0, + 'upload_date': '20210111', + } + }] + }, ] def report_following_redirect(self, new_url): diff --git a/yt_dlp/extractor/jwplatform.py b/yt_dlp/extractor/jwplatform.py index 8dbbb2926..1bf58d517 100644 --- a/yt_dlp/extractor/jwplatform.py +++ b/yt_dlp/extractor/jwplatform.py @@ -37,6 +37,9 @@ def _extract_urls(webpage): webpage) if ret: return ret + mobj = re.search(r']* data-video-jw-id="([a-zA-Z0-9]{8})"', webpage) + if mobj: + return [f'jwplatform:{mobj.group(1)}'] def _real_extract(self, url): url, smuggled_data = unsmuggle_url(url, {})