music-kraken-core/src/musify_search.py

52 lines
1.5 KiB
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-04-03 14:23:30 +00:00
artist = objects.Artist(
source_list=[objects.Source(objects.SourcePages.MUSIFY, "https://musify.club/artist/ghost-bath-280348/")]
)
2023-04-04 08:05:37 +00:00
artist = objects.Artist(
source_list=[objects.Source(objects.SourcePages.MUSIFY, "https://musify.club/artist/lana-del-rey-124788/releases")]
)
2023-04-03 15:41:52 +00:00
artist: objects.Artist = Musify.fetch_details(artist)
2023-03-17 11:31:56 +00:00
print(artist.options)
2023-04-03 15:41:52 +00:00
print(artist.main_album_collection[0].source_collection)
2023-03-17 11:31:56 +00:00
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-04-03 15:41:52 +00:00
album = objects.Album(
source_list=[
objects.Source(objects.SourcePages.MUSIFY, "https://musify.club/release/ghost-bath-self-loather-2021-1554266")
]
)
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__":
2023-04-04 08:05:37 +00:00
fetch_artist()