Rewrite CLI
This commit is contained in:
8
traps/utils.py
Normal file
8
traps/utils.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import pathlib
|
||||
import urllib.parse
|
||||
|
||||
|
||||
def filename_from_url(url: str) -> str:
|
||||
path = urllib.parse.urlparse(url).path
|
||||
filename = pathlib.Path(path).name
|
||||
return filename
|
||||
Reference in New Issue
Block a user