]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/itv.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / itv.py
index bdd6af6884fab1f663e35c8a1adc7e2c4980d7fe..9ac7be3074b7a5a8854c59b4620ed4f97b41d52b 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import json
 
 from .common import InfoExtractor
@@ -175,7 +172,6 @@ def _real_extract(self, url):
                 formats.append({
                     'url': href,
                 })
-        self._sort_formats(formats)
         info = self._search_json_ld(webpage, video_id, default={})
         if not info:
             json_ld = self._parse_json(self._search_regex(
@@ -243,8 +239,8 @@ def _real_extract(self, url):
 
         webpage = self._download_webpage(url, playlist_id)
 
-        json_map = try_get(self._parse_json(self._html_search_regex(
-            '(?s)<script[^>]+id=[\'"]__NEXT_DATA__[^>]*>([^<]+)</script>', webpage, 'json_map'), playlist_id),
+        json_map = try_get(
+            self._search_nextjs_data(webpage, playlist_id),
             lambda x: x['props']['pageProps']['article']['body']['content']) or []
 
         entries = []