fixed borderline stupid bug

This commit is contained in:
Hellow 2023-05-24 18:02:19 +02:00
parent 486da4b43c
commit 8af48fb4d4
4 changed files with 10 additions and 8 deletions

View File

@ -1,11 +1,12 @@
import music_kraken
from music_kraken import pages
from music_kraken.download import Search
from music_kraken.utils.enums.source import SourcePages
from music_kraken.objects import Song, Target, Source, Album
def search_pages():
search = pages.Search()
search = Search()
print("metadata", search.pages)
print("audio", search.audio_pages)
@ -22,7 +23,7 @@ def search_pages():
def direct_download():
search = pages.Search()
search = Search()
search.search_url("https://www.metal-archives.com/bands/Ghost_Bath/3540372489")
print(search)
@ -46,7 +47,7 @@ def download_audio():
def real_download():
search = pages.Search()
search = Search()
search.search_url("https://musify.club/release/children-of-the-night-2018-1079829")
search.download_chosen()
@ -56,7 +57,7 @@ if __name__ == "__main__":
# "https://musify.club/release/molchat-doma-etazhi-2018-1092949",
# "https://musify.club/release/ghost-bath-self-loather-2021-1554266",
"#a Ghost Bath",
"0",
"1",
"4",
"ok"
])

View File

@ -10,6 +10,7 @@ SOURCE_PAGE_MAP: Dict[SourcePages, Page] = dict()
ALL_PAGES: Tuple[Page, ...] = (
EncyclopaediaMetallum(),
Musify()
)
AUDIO_PAGES: Tuple[Page, ...] = (

View File

@ -108,7 +108,7 @@ def parse_url(url: str) -> MusifyUrl:
)
class Preset(Page):
class Musify(Page):
# CHANGE
SOURCE_TYPE = SourcePages.MUSIFY
LOGGER = MUSIFY_LOGGER
@ -129,7 +129,7 @@ class Preset(Page):
musify_url = parse_url(source.url)
# Has no labels, because afaiak musify has no Labels
# Has no labels, because afaik musify has no Labels
musify_type_to_database_type = {
MusifyTypes.SONG: Song,
MusifyTypes.RELEASE: Album,
@ -999,7 +999,7 @@ class Preset(Page):
return Label()
class Musify(Page):
class OldMusify(Page):
API_SESSION: requests.Session = requests.Session()
API_SESSION.headers = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0",

View File

@ -3,7 +3,7 @@ from urllib.parse import urlparse
import logging
from music_kraken.objects import Source, DatabaseObject
from ..objects import Source, DatabaseObject
from .abstract import Page
from ..objects import (
Artist,