cleanup
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
import os
|
||||
|
||||
from yandex_music import Client
|
||||
|
||||
client = Client('AQAAAAAzqNkbAAG8XrWGNg9A5kCakiE_9HDst58').init()
|
||||
|
||||
|
||||
def search(_str: str, _type: str = 'all') -> dict:
|
||||
album_id = None
|
||||
album_title = None
|
||||
artist_id = None
|
||||
artist_name = None
|
||||
result_json = {}
|
||||
|
||||
search_result = client.search(_str, type_=_type)
|
||||
type_ = search_result.best.type
|
||||
best = search_result.best.result
|
||||
# print(search_result)
|
||||
|
||||
if type_ == 'track':
|
||||
artists = ''
|
||||
if best.artists:
|
||||
@@ -18,9 +22,6 @@ def search(_str: str, _type: str = 'all') -> dict:
|
||||
for i in best.albums:
|
||||
album_id = i.id
|
||||
album_title = i.title
|
||||
else:
|
||||
album_id = None
|
||||
album_title = None
|
||||
|
||||
# Generate json for track
|
||||
result_json = {
|
||||
|
||||
Reference in New Issue
Block a user