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 {