mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
parent
cbd4f237b4
commit
ebf99aaf70
1 changed files with 5 additions and 1 deletions
|
@ -2405,7 +2405,11 @@ def remove_quotes(s):
|
||||||
|
|
||||||
|
|
||||||
def get_domain(url):
|
def get_domain(url):
|
||||||
return '.'.join(urllib.parse.urlparse(url).netloc.rsplit('.', 2)[-2:])
|
"""
|
||||||
|
This implementation is inconsistent, but is kept for compatibility.
|
||||||
|
Use this only for "webpage_url_domain"
|
||||||
|
"""
|
||||||
|
return remove_start(urllib.parse.urlparse(url).netloc, 'www.') or None
|
||||||
|
|
||||||
|
|
||||||
def url_basename(url):
|
def url_basename(url):
|
||||||
|
|
Loading…
Reference in a new issue