From c7153f95beec258fc2178c1072e4caf1b4a66031 Mon Sep 17 00:00:00 2001 From: srki <54671367+u-spec-png@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:27:03 +0200 Subject: [PATCH] Use hostname --- yt_dlp/extractor/n1.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/yt_dlp/extractor/n1.py b/yt_dlp/extractor/n1.py index 30a9b325f..6e3d69682 100644 --- a/yt_dlp/extractor/n1.py +++ b/yt_dlp/extractor/n1.py @@ -182,13 +182,12 @@ def _real_extract(self, url): for embedded_video in embedded_videos: video_data = extract_attributes(embedded_video) url = video_data.get('src') or '' - if url: - url = parse.urlparse(url).hostname - if url == 'www.youtube.com': + hostname = parse.urlparse(url).hostname + if hostname == 'www.youtube.com': entries.append(self.url_result(url, ie='Youtube')) - elif url == 'www.redditmedia.com': + elif hostname == 'www.redditmedia.com': entries.append(self.url_result(url, ie='Reddit')) - elif url == 'www.facebook.com' and 'plugins/video' in url: + elif hostname == 'www.facebook.com' and 'plugins/video' in url: entries.append(self.url_result(url, ie='FacebookPluginsVideo')) return {