]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[udemy] Add support for new URL schema
authorSergey M․ <dstftw@gmail.com>
Thu, 24 Mar 2016 20:28:39 +0000 (02:28 +0600)
committerSergey M․ <dstftw@gmail.com>
Thu, 24 Mar 2016 20:28:39 +0000 (02:28 +0600)
youtube_dl/extractor/udemy.py

index 2b886d6c846c25fec95d21ad431aefa2efdc3e1b..a9046b86554c962c586ea5ab2213e64ec70721ae 100644 (file)
@@ -18,7 +18,16 @@ from ..utils import (
 
 class UdemyIE(InfoExtractor):
     IE_NAME = 'udemy'
-    _VALID_URL = r'https?://www\.udemy\.com/(?:[^#]+#/lecture/|lecture/view/?\?lectureId=)(?P<id>\d+)'
+    _VALID_URL = r'''(?x)
+                    https?://
+                        www\.udemy\.com/
+                        (?:
+                            [^#]+\#/lecture/|
+                            lecture/view/?\?lectureId=|
+                            [^/]+/learn/v4/t/lecture/
+                        )
+                        (?P<id>\d+)
+                    '''
     _LOGIN_URL = 'https://www.udemy.com/join/login-popup/?displayType=ajax&showSkipButton=1'
     _ORIGIN_URL = 'https://www.udemy.com'
     _NETRC_MACHINE = 'udemy'
@@ -34,6 +43,10 @@ class UdemyIE(InfoExtractor):
             'duration': 579.29,
         },
         'skip': 'Requires udemy account credentials',
+    }, {
+        # new URL schema
+        'url': 'https://www.udemy.com/electric-bass-right-from-the-start/learn/v4/t/lecture/4580906',
+        'only_matching': True,
     }]
 
     def _enroll_course(self, base_url, webpage, course_id):