mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	Simplify url_basename
Use urlparse from the standard library.
This commit is contained in:
		| @@ -1092,7 +1092,5 @@ def remove_start(s, start): | ||||
|  | ||||
|  | ||||
| def url_basename(url): | ||||
|     m = re.match(r'(?:https?:|)//[^/]+/(?:[^?#]+/)?([^/?#]+)/?(?:[?#]|$)', url) | ||||
|     if not m: | ||||
|         return u'' | ||||
|     return m.group(1) | ||||
|     path = compat_urlparse.urlparse(url).path | ||||
|     return path.strip(u'/').split(u'/')[-1] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jaime Marquínez Ferrándiz
					Jaime Marquínez Ferrándiz