[udemy:course] Simplify course curriculum downloading
authorSergey M․ <dstftw@gmail.com>
Thu, 31 Mar 2016 16:59:19 +0000 (22:59 +0600)
committerSergey M․ <dstftw@gmail.com>
Thu, 31 Mar 2016 16:59:19 +0000 (22:59 +0600)
youtube_dl/extractor/udemy.py

index 2e54dbc1129daacabe5b53ea46a8fd33cb1dd7a8..1784599e9dac8b1a1f1da56c5cec7966219114cf 100644 (file)
@@ -322,17 +322,14 @@ class UdemyCourseIE(UdemyIE):
 
         self._enroll_course(url, webpage, course_id)
 
-        course_url = update_url_query(
+        response = self._download_json(
             'https://www.udemy.com/api-2.0/courses/%s/cached-subscriber-curriculum-items' % course_id,
-            {
+            course_id, 'Downloading course curriculum', query={
                 'fields[chapter]': 'title,object_index',
                 'fields[lecture]': 'title',
                 'page_size': '1000',
             })
 
-        response = self._download_json(
-            course_url, course_id, 'Downloading course curriculum')
-
         entries = []
         chapter, chapter_number = [None] * 2
         for entry in response['results']: