]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/vidlii.py
[ie/mlbtv] Fix extraction (#10296)
[yt-dlp.git] / yt_dlp / extractor / vidlii.py
index 5933783ae6f0da3670bec2fda38c8b389978aa6d..d9e33ca9e58b9f60235ee1b79aa25918503cd350 100644 (file)
@@ -1,10 +1,10 @@
 import re
 
 from .common import InfoExtractor
+from ..networking import HEADRequest
 from ..utils import (
-    HEADRequest,
-    format_field,
     float_or_none,
+    format_field,
     get_element_by_id,
     int_or_none,
     str_to_int,
@@ -34,7 +34,7 @@ class VidLiiIE(InfoExtractor):
             'average_rating': float,
             'categories': ['News & Politics'],
             'tags': ['Vidlii', 'Jan', 'Videogames'],
-        }
+        },
     }, {
         'url': 'https://www.vidlii.com/watch?v=zTAtaAgOLKt',
         'md5': '5778f7366aa4c569b77002f8bf6b614f',
@@ -63,13 +63,14 @@ def _real_extract(self, url):
         video_id = self._match_id(url)
 
         webpage = self._download_webpage(
-            'https://www.vidlii.com/watch?v=%s' % video_id, video_id)
+            f'https://www.vidlii.com/watch?v={video_id}', video_id)
         formats = []
 
         sources = [source[1] for source in re.findall(
             r'src\s*:\s*(["\'])(?P<url>(?:https?://)?(?:(?!\1).)+)\1',
             webpage) or []]
         for source in sources:
+            source = urljoin(url, source)
             height = int(self._search_regex(r'(\d+).mp4', source, 'height', default=360))
             if self._request_webpage(HEADRequest(source), video_id, f'Checking {height}p url', errnote=False):
                 formats.append({