mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-06-30 11:02:51 -05:00
[utils] Introduce base_url
This commit is contained in:
@ -1691,6 +1691,10 @@ def url_basename(url):
|
||||
return path.strip('/').split('/')[-1]
|
||||
|
||||
|
||||
def base_url(url):
|
||||
return re.match(r'https?://[^?#&]+/', url).group()
|
||||
|
||||
|
||||
class HEADRequest(compat_urllib_request.Request):
|
||||
def get_method(self):
|
||||
return 'HEAD'
|
||||
|
Reference in New Issue
Block a user