]> jfr.im git - yt-dlp.git/commitdiff
[extractor/jwplatform] Look for `data-video-jw-id`
authorpukkandan <redacted>
Sat, 11 Jun 2022 21:55:55 +0000 (03:25 +0530)
committerpukkandan <redacted>
Sat, 11 Jun 2022 21:56:00 +0000 (03:26 +0530)
Closes #3821

yt_dlp/extractor/generic.py
yt_dlp/extractor/jwplatform.py

index c7e9ea059fb44bc7446968b74cb8a02ef73d3553..36e82ca04b6129b736e3ecf34e9e659226895463 100644 (file)
@@ -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):
index 8dbbb292605e63f5fd883086284ea2a2b2071b65..1bf58d517a7404db5b2c2613ab10638f049f6d22 100644 (file)
@@ -37,6 +37,9 @@ def _extract_urls(webpage):
                 webpage)
             if ret:
                 return ret
+        mobj = re.search(r'<div\b[^>]* 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, {})