mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-15 00:48:28 +00:00
Use hostname
This commit is contained in:
parent
64cf8a75d4
commit
c7153f95be
@ -182,13 +182,12 @@ def _real_extract(self, url):
|
|||||||
for embedded_video in embedded_videos:
|
for embedded_video in embedded_videos:
|
||||||
video_data = extract_attributes(embedded_video)
|
video_data = extract_attributes(embedded_video)
|
||||||
url = video_data.get('src') or ''
|
url = video_data.get('src') or ''
|
||||||
if url:
|
hostname = parse.urlparse(url).hostname
|
||||||
url = parse.urlparse(url).hostname
|
if hostname == 'www.youtube.com':
|
||||||
if url == 'www.youtube.com':
|
|
||||||
entries.append(self.url_result(url, ie='Youtube'))
|
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'))
|
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'))
|
entries.append(self.url_result(url, ie='FacebookPluginsVideo'))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user