]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[udemy] add another course id extraction pattern(closes #20491)
authorRemita Amine <remitamine@gmail.com>
Fri, 19 Apr 2019 19:44:31 +0000 (20:44 +0100)
committerRemita Amine <remitamine@gmail.com>
Fri, 19 Apr 2019 19:44:59 +0000 (20:44 +0100)
youtube_dl/extractor/udemy.py

index 66ea6fb1516a406ec06cfd60525bd9e0c0987ef6..2a4faecefbc271f1f88dfe38d2fe284e0bbd9158 100644 (file)
@@ -76,7 +76,10 @@ class UdemyIE(InfoExtractor):
                 webpage, 'course', default='{}')),
             video_id, fatal=False) or {}
         course_id = course.get('id') or self._search_regex(
-            r'data-course-id=["\'](\d+)', webpage, 'course id')
+            [
+                r'data-course-id=["\'](\d+)',
+                r'&quot;courseId&quot;\s*:\s*(\d+)'
+            ], webpage, 'course id')
         return course_id, course.get('title')
 
     def _enroll_course(self, base_url, webpage, course_id):