]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/egghead.py
[cleanup, ie] Match both `http` and `https` in `_VALID_URL` (#8968)
[yt-dlp.git] / yt_dlp / extractor / egghead.py
index b6b86768c230f8e9b91230e18b0a109dff3e3de5..c94f3f81f66c7daf6259421471fc3c903088d65f 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..compat import compat_str
 from ..utils import (
@@ -22,7 +19,7 @@ def _call_api(self, path, video_id, resource, fatal=True):
 class EggheadCourseIE(EggheadBaseIE):
     IE_DESC = 'egghead.io course'
     IE_NAME = 'egghead:course'
-    _VALID_URL = r'https://(?:app\.)?egghead\.io/(?:course|playlist)s/(?P<id>[^/?#&]+)'
+    _VALID_URL = r'https?://(?:app\.)?egghead\.io/(?:course|playlist)s/(?P<id>[^/?#&]+)'
     _TESTS = [{
         'url': 'https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript',
         'playlist_count': 29,
@@ -68,7 +65,7 @@ def _real_extract(self, url):
 class EggheadLessonIE(EggheadBaseIE):
     IE_DESC = 'egghead.io lesson'
     IE_NAME = 'egghead:lesson'
-    _VALID_URL = r'https://(?:app\.)?egghead\.io/(?:api/v1/)?lessons/(?P<id>[^/?#&]+)'
+    _VALID_URL = r'https?://(?:app\.)?egghead\.io/(?:api/v1/)?lessons/(?P<id>[^/?#&]+)'
     _TESTS = [{
         'url': 'https://egghead.io/lessons/javascript-linear-data-flow-with-container-style-types-box',
         'info_dict': {
@@ -120,7 +117,6 @@ def _real_extract(self, url):
                 formats.append({
                     'url': format_url,
                 })
-        self._sort_formats(formats)
 
         return {
             'id': lesson_id,