music-kraken-core/src/musify_search.py

37 lines
980 B
Python
Raw Normal View History

2023-03-15 19:55:28 +00:00
from music_kraken import objects
from music_kraken.pages import Musify
2023-03-17 11:31:56 +00:00
def search():
results = Musify.search_by_query("#a Ghost Bath")
print(results)
2023-03-15 19:55:28 +00:00
2023-03-17 11:31:56 +00:00
def fetch_artist():
artist = objects.Artist(
2023-03-17 22:55:38 +00:00
source_list=[objects.Source(objects.SourcePages.MUSIFY, "https://musify.club/artist/psychonaut-4-83193")]
2023-03-17 11:31:56 +00:00
)
2023-03-17 11:31:56 +00:00
artist = Musify.fetch_details(artist)
print(artist.options)
2023-03-20 16:03:14 +00:00
def fetch_album():
album = objects.Album(
source_list=[objects.Source(objects.SourcePages.MUSIFY,
"https://musify.club/release/linkin-park-hybrid-theory-2000-188")]
2023-03-20 16:03:14 +00:00
)
2023-03-24 14:58:21 +00:00
album: objects.Album = Musify.fetch_details(album)
2023-03-20 16:03:14 +00:00
print(album.options)
2023-03-24 14:58:21 +00:00
song: objects.Song
for artist in album.artist_collection:
print(artist.id, artist.name)
for song in album.song_collection:
for artist in song.main_artist_collection:
print(artist.id, artist.name)
2023-03-17 11:31:56 +00:00
if __name__ == "__main__":
search()