mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-15 00:48:28 +00:00
Use parse.urlparse
This commit is contained in:
parent
7ee2e69905
commit
64cf8a75d4
@ -1,4 +1,5 @@
|
||||
import re
|
||||
from urllib import parse
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
@ -181,11 +182,13 @@ 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.startswith('https://www.youtube.com'):
|
||||
if url:
|
||||
url = parse.urlparse(url).hostname
|
||||
if url == 'www.youtube.com':
|
||||
entries.append(self.url_result(url, ie='Youtube'))
|
||||
elif url.startswith('https://www.redditmedia.com'):
|
||||
elif url == 'www.redditmedia.com':
|
||||
entries.append(self.url_result(url, ie='Reddit'))
|
||||
elif url.startswith('https://www.facebook.com') and 'plugins/video' in url:
|
||||
elif url == 'www.facebook.com' and 'plugins/video' in url:
|
||||
entries.append(self.url_result(url, ie='FacebookPluginsVideo'))
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user