made the direct downloads work

This commit is contained in:
Hellow2
2023-03-30 12:31:37 +02:00
parent 79b2dc4394
commit cc7eb41ac7
3 changed files with 14 additions and 2 deletions

View File

@@ -83,6 +83,9 @@ class Source(DatabaseObject):
"""
parsed = urlparse(url)
url = parsed.geturl()
if "musify" in parsed.netloc:
return cls(SourcePages.MUSIFY, url)
if url.startswith("https://www.youtube"):
return cls(SourcePages.YOUTUBE, url)

View File

@@ -7,7 +7,7 @@ from ..musify import Musify
NAME_PAGE_MAP: Dict[str, Type[Page]] = dict()
PAGE_NAME_MAP: Dict[Type[Page], str] = dict()
SOURCE_PAGE_MAP: Dict[SourcePages, Type[Page]]
SOURCE_PAGE_MAP: Dict[SourcePages, Type[Page]] = dict()
ALL_PAGES: Tuple[Type[Page]] = (
EncyclopaediaMetallum,