Compare commits
1 commit
master
...
url-parsin
Author | SHA1 | Date | |
---|---|---|---|
|
ac3057fd52 |
1 changed files with 14 additions and 0 deletions
14
url.py
Normal file
14
url.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
def parse_link(url):
|
||||||
|
u = urlparse(url)
|
||||||
|
match u.netloc:
|
||||||
|
case 'www.imdb.com' | 'imdb.com':
|
||||||
|
parse_imdb(u.path)
|
||||||
|
case 'myanimelist.net':
|
||||||
|
parse_mal(u.path)
|
||||||
|
case _:
|
||||||
|
url_not_supported(u)
|
||||||
|
|
||||||
|
def parse_mal(path):
|
||||||
|
|
Loading…
Add table
Reference in a new issue