]> jfr.im git - yt-dlp.git/commitdiff
[jwplatform] Add support for `hyland.com`
authorpukkandan <redacted>
Mon, 22 Feb 2021 20:45:51 +0000 (02:15 +0530)
committerpukkandan <redacted>
Mon, 22 Feb 2021 21:01:55 +0000 (02:31 +0530)
Related: https://github.com/ytdl-org/youtube-dl/issues/12918

:ci skip dl

youtube_dlc/extractor/jwplatform.py

index c34b5f5e6bd9e7d38e762f5d82f3669ac2c438a2..5aa508bf9871b8755dd2ab55ba120726884a0c0a 100644 (file)
@@ -32,9 +32,14 @@ def _extract_url(webpage):
 
     @staticmethod
     def _extract_urls(webpage):
-        return re.findall(
-            r'<(?:script|iframe)[^>]+?src=["\']((?:https?:)?//(?:content\.jwplatform|cdn\.jwplayer)\.com/players/[a-zA-Z0-9]{8})',
-            webpage)
+        for tag, key in ((r'(?:script|iframe)', 'src'), ('input', 'value')):
+            # <input value=URL> is used by hyland.com
+            # if we find <iframe>, dont look for <input>
+            ret = re.findall(
+                r'<%s[^>]+?%s=["\']((?:https?:)?//(?:content\.jwplatform|cdn\.jwplayer)\.com/players/[a-zA-Z0-9]{8})' % (tag, key),
+                webpage)
+            if ret:
+                return ret
 
     def _real_extract(self, url):
         url, smuggled_data = unsmuggle_url(url, {})