fixed borderline stupid bug
This commit is contained in:
parent
486da4b43c
commit
8af48fb4d4
@ -1,11 +1,12 @@
|
|||||||
import music_kraken
|
import music_kraken
|
||||||
from music_kraken import pages
|
from music_kraken import pages
|
||||||
|
from music_kraken.download import Search
|
||||||
from music_kraken.utils.enums.source import SourcePages
|
from music_kraken.utils.enums.source import SourcePages
|
||||||
from music_kraken.objects import Song, Target, Source, Album
|
from music_kraken.objects import Song, Target, Source, Album
|
||||||
|
|
||||||
|
|
||||||
def search_pages():
|
def search_pages():
|
||||||
search = pages.Search()
|
search = Search()
|
||||||
print("metadata", search.pages)
|
print("metadata", search.pages)
|
||||||
print("audio", search.audio_pages)
|
print("audio", search.audio_pages)
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ def search_pages():
|
|||||||
|
|
||||||
|
|
||||||
def direct_download():
|
def direct_download():
|
||||||
search = pages.Search()
|
search = Search()
|
||||||
|
|
||||||
search.search_url("https://www.metal-archives.com/bands/Ghost_Bath/3540372489")
|
search.search_url("https://www.metal-archives.com/bands/Ghost_Bath/3540372489")
|
||||||
print(search)
|
print(search)
|
||||||
@ -46,7 +47,7 @@ def download_audio():
|
|||||||
|
|
||||||
|
|
||||||
def real_download():
|
def real_download():
|
||||||
search = pages.Search()
|
search = Search()
|
||||||
search.search_url("https://musify.club/release/children-of-the-night-2018-1079829")
|
search.search_url("https://musify.club/release/children-of-the-night-2018-1079829")
|
||||||
search.download_chosen()
|
search.download_chosen()
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ if __name__ == "__main__":
|
|||||||
# "https://musify.club/release/molchat-doma-etazhi-2018-1092949",
|
# "https://musify.club/release/molchat-doma-etazhi-2018-1092949",
|
||||||
# "https://musify.club/release/ghost-bath-self-loather-2021-1554266",
|
# "https://musify.club/release/ghost-bath-self-loather-2021-1554266",
|
||||||
"#a Ghost Bath",
|
"#a Ghost Bath",
|
||||||
"0",
|
"1",
|
||||||
"4",
|
"4",
|
||||||
"ok"
|
"ok"
|
||||||
])
|
])
|
||||||
|
@ -10,6 +10,7 @@ SOURCE_PAGE_MAP: Dict[SourcePages, Page] = dict()
|
|||||||
|
|
||||||
ALL_PAGES: Tuple[Page, ...] = (
|
ALL_PAGES: Tuple[Page, ...] = (
|
||||||
EncyclopaediaMetallum(),
|
EncyclopaediaMetallum(),
|
||||||
|
Musify()
|
||||||
)
|
)
|
||||||
|
|
||||||
AUDIO_PAGES: Tuple[Page, ...] = (
|
AUDIO_PAGES: Tuple[Page, ...] = (
|
||||||
|
@ -108,7 +108,7 @@ def parse_url(url: str) -> MusifyUrl:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class Preset(Page):
|
class Musify(Page):
|
||||||
# CHANGE
|
# CHANGE
|
||||||
SOURCE_TYPE = SourcePages.MUSIFY
|
SOURCE_TYPE = SourcePages.MUSIFY
|
||||||
LOGGER = MUSIFY_LOGGER
|
LOGGER = MUSIFY_LOGGER
|
||||||
@ -129,7 +129,7 @@ class Preset(Page):
|
|||||||
|
|
||||||
musify_url = parse_url(source.url)
|
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 = {
|
musify_type_to_database_type = {
|
||||||
MusifyTypes.SONG: Song,
|
MusifyTypes.SONG: Song,
|
||||||
MusifyTypes.RELEASE: Album,
|
MusifyTypes.RELEASE: Album,
|
||||||
@ -999,7 +999,7 @@ class Preset(Page):
|
|||||||
return Label()
|
return Label()
|
||||||
|
|
||||||
|
|
||||||
class Musify(Page):
|
class OldMusify(Page):
|
||||||
API_SESSION: requests.Session = requests.Session()
|
API_SESSION: requests.Session = requests.Session()
|
||||||
API_SESSION.headers = {
|
API_SESSION.headers = {
|
||||||
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0",
|
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0",
|
||||||
|
@ -3,7 +3,7 @@ from urllib.parse import urlparse
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
from music_kraken.objects import Source, DatabaseObject
|
from ..objects import Source, DatabaseObject
|
||||||
from .abstract import Page
|
from .abstract import Page
|
||||||
from ..objects import (
|
from ..objects import (
|
||||||
Artist,
|
Artist,
|
||||||
|
Loading…
Reference in New Issue
Block a user