]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/theweatherchannel.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / theweatherchannel.py
index b2a8c3797e9ebe43da451a39da5ab3d56c043aa6..682e4335d2c55fa1d6ab76b8ee5244257b887645 100644 (file)
@@ -1,8 +1,4 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import json
-import re
 
 from .theplatform import ThePlatformIE
 from ..utils import (
@@ -12,7 +8,7 @@
 )
 
 
-class TheWeatherChannelIE(ThePlatformIE):
+class TheWeatherChannelIE(ThePlatformIE):  # XXX: Do not subclass from concrete IE
     _VALID_URL = r'https?://(?:www\.)?weather\.com(?P<asset_name>(?:/(?P<locale>[a-z]{2}-[A-Z]{2}))?/(?:[^/]+/)*video/(?P<id>[^/?#]+))'
     _TESTS = [{
         'url': 'https://weather.com/series/great-outdoors/video/ice-climber-is-in-for-a-shock',
@@ -33,7 +29,7 @@ class TheWeatherChannelIE(ThePlatformIE):
     }]
 
     def _real_extract(self, url):
-        asset_name, locale, display_id = re.match(self._VALID_URL, url).groups()
+        asset_name, locale, display_id = self._match_valid_url(url).groups()
         if not locale:
             locale = 'en-US'
         video_data = list(self._download_json(
@@ -83,7 +79,6 @@ def _real_extract(self, url):
                     'url': variant_url,
                     'format_id': variant_id,
                 })
-        self._sort_formats(formats)
 
         cc_url = video_data.get('cc_url')