2023-01-30 22:54:21 +00:00
|
|
|
from music_kraken import (
|
|
|
|
Song,
|
2023-01-31 12:18:52 +00:00
|
|
|
Database,
|
|
|
|
Artist
|
2023-01-30 22:54:21 +00:00
|
|
|
)
|
|
|
|
|
2023-01-23 23:16:10 +00:00
|
|
|
from music_kraken.pages import (
|
|
|
|
EncyclopaediaMetallum
|
2022-12-06 16:55:07 +00:00
|
|
|
)
|
2022-11-24 13:13:55 +00:00
|
|
|
|
2023-01-30 22:54:21 +00:00
|
|
|
|
|
|
|
test_db = Database("test.db")
|
|
|
|
# test_db.reset()
|
|
|
|
|
|
|
|
def print_song(song_: Song):
|
|
|
|
print(str(song_.metadata))
|
|
|
|
print("----album--")
|
|
|
|
print(song_.album)
|
|
|
|
print("----src----")
|
|
|
|
print("song:")
|
|
|
|
print(song_.source_list)
|
|
|
|
print("album:")
|
|
|
|
print(song_.album.source_list)
|
2023-01-31 12:18:52 +00:00
|
|
|
print("artist:")
|
|
|
|
print([a.source_list for a in song_.main_artist_list])
|
|
|
|
print([a.source_list for a in song_.feature_artist_list])
|
2023-01-30 22:54:21 +00:00
|
|
|
print("\n")
|
|
|
|
|
2023-01-31 12:18:52 +00:00
|
|
|
def print_artist(artist: Artist):
|
|
|
|
print(artist)
|
|
|
|
print("---discography---")
|
|
|
|
for album in artist.discography:
|
|
|
|
print(album)
|
|
|
|
|
2023-01-30 22:54:21 +00:00
|
|
|
|
2023-01-24 17:15:07 +00:00
|
|
|
# only_smile = EncyclopaediaMetallum.search_by_query("only smile")
|
|
|
|
# print(EncyclopaediaMetallum.search_by_query("#a Ghost Bath"))
|
|
|
|
# print(EncyclopaediaMetallum.search_by_query("#a Ghost Bath #r Self Loather"))
|
2023-01-30 22:54:21 +00:00
|
|
|
|
|
|
|
songs_in_db = test_db.pull_songs()
|
|
|
|
song: Song
|
|
|
|
|
|
|
|
if len(songs_in_db) <= 0:
|
|
|
|
print("didn't find song in db.... downloading")
|
|
|
|
song: Song = EncyclopaediaMetallum.search_by_query("#a Ghost Bath #r Self Loather #t hide from the sun")[0]
|
|
|
|
test_db.push_song(song)
|
|
|
|
else:
|
|
|
|
print("found song in database")
|
|
|
|
song = songs_in_db[0]
|
|
|
|
|
|
|
|
print_song(song)
|
|
|
|
|
|
|
|
artist = song.main_artist_list[0]
|
2023-01-31 12:27:28 +00:00
|
|
|
|
|
|
|
print_artist(artist)
|
|
|
|
|
2023-01-30 22:54:21 +00:00
|
|
|
artist = EncyclopaediaMetallum.fetch_artist_details(artist)
|
2023-01-24 17:15:07 +00:00
|
|
|
|
2023-01-31 12:18:52 +00:00
|
|
|
print_artist(artist)
|
|
|
|
|
2023-01-24 17:15:07 +00:00
|
|
|
# print(only_smile)
|