]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/lecturio.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / lecturio.py
index 1b2dcef46621237fd7c7ce376165a6bc5c674606..973764c63f760bbf15347af0f38f2f22609a29f3 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import re
 
 from .common import InfoExtractor
@@ -22,14 +19,7 @@ class LecturioBaseIE(InfoExtractor):
     _LOGIN_URL = 'https://app.lecturio.com/en/login'
     _NETRC_MACHINE = 'lecturio'
 
-    def _real_initialize(self):
-        self._login()
-
-    def _login(self):
-        username, password = self._get_login_info()
-        if username is None:
-            return
-
+    def _perform_login(self, username, password):
         # Sets some cookies
         _, urlh = self._download_webpage_handle(
             self._LOGIN_URL, None, 'Downloading login popup')
@@ -103,7 +93,7 @@ class LecturioIE(LecturioBaseIE):
     }
 
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
+        mobj = self._match_valid_url(url)
         nt = mobj.group('nt') or mobj.group('nt_de')
         lecture_id = mobj.group('id')
         display_id = nt or lecture_id
@@ -147,7 +137,6 @@ def _real_extract(self, url):
                         'height': int(mobj.group(1)),
                     })
             formats.append(f)
-        self._sort_formats(formats)
 
         subtitles = {}
         automatic_captions = {}
@@ -196,7 +185,7 @@ class LecturioCourseIE(LecturioBaseIE):
     }]
 
     def _real_extract(self, url):
-        nt, course_id = re.match(self._VALID_URL, url).groups()
+        nt, course_id = self._match_valid_url(url).groups()
         display_id = nt or course_id
         api_path = 'courses/' + course_id if course_id else 'course/content/' + nt + '.json'
         course = self._download_json(