]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/canalplus.py
[ie/orf:on] Improve extraction (#9677)
[yt-dlp.git] / yt_dlp / extractor / canalplus.py
index 1132ce4a74ca8622935df88bcc4e74bc77485e17..3ff5c3fbfcbede4a537e5a1763f6bed46e91630a 100644 (file)
@@ -1,8 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
 from .common import InfoExtractor
 from ..utils import (
     # ExtractorError,
@@ -50,7 +45,7 @@ class CanalplusIE(InfoExtractor):
     }]
 
     def _real_extract(self, url):
-        site, display_id, video_id = re.match(self._VALID_URL, url).groups()
+        site, display_id, video_id = self._match_valid_url(url).groups()
 
         site_id = self._SITE_ID_MAP[site]
 
@@ -69,7 +64,7 @@ def _real_extract(self, url):
         #     response = self._request_webpage(
         #         HEADRequest(fmt_url), video_id,
         #         'Checking if the video is georestricted')
-        #     if '/blocage' in response.geturl():
+        #     if '/blocage' in response.url:
         #         raise ExtractorError(
         #             'The video is not available in your country',
         #             expected=True)
@@ -91,7 +86,6 @@ def _real_extract(self, url):
                     'format_id': format_id,
                     'quality': preference(format_id),
                 })
-        self._sort_formats(formats)
 
         thumbnails = [{
             'id': image_id,