mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-07-04 04:52:52 -05:00
[extractor] Framework for embed detection (#4307)
This commit is contained in:
@ -705,13 +705,13 @@ def sanitize_path(s, force=False):
|
||||
return os.path.join(*sanitized_path)
|
||||
|
||||
|
||||
def sanitize_url(url):
|
||||
def sanitize_url(url, *, scheme='http'):
|
||||
# Prepend protocol-less URLs with `http:` scheme in order to mitigate
|
||||
# the number of unwanted failures due to missing protocol
|
||||
if url is None:
|
||||
return
|
||||
elif url.startswith('//'):
|
||||
return 'http:%s' % url
|
||||
return f'{scheme}:{url}'
|
||||
# Fix some common typos seen so far
|
||||
COMMON_TYPOS = (
|
||||
# https://github.com/ytdl-org/youtube-dl/issues/15649
|
||||
|
Reference in New Issue
Block a user