discord-cinema-bot/url.py

14 lines
308 B
Python
Raw Permalink Normal View History

2021-05-21 19:52:50 +02:00
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):