diff --git a/src/music_kraken/objects/source.py b/src/music_kraken/objects/source.py index 85a8755..fdcc4c1 100644 --- a/src/music_kraken/objects/source.py +++ b/src/music_kraken/objects/source.py @@ -28,7 +28,7 @@ class Source(DatabaseObject): def __init__( self, page_enum: SourcePages, - url: str, + url: str = None, id_: str = None, referer_page: SourcePages = None, adio_url: str = None diff --git a/src/music_kraken/pages/musify.py b/src/music_kraken/pages/musify.py index 6ce3b71..9ed1e52 100644 --- a/src/music_kraken/pages/musify.py +++ b/src/music_kraken/pages/musify.py @@ -424,7 +424,8 @@ class Musify(Page): nonlocal name nonlocal artist_name - # example of just setting not working: https://musify.club/release/unjoy-eurythmie-psychonaut-4-tired-numb-still-alive-2012-324067 + # example of just setting not working: + # https://musify.club/release/unjoy-eurythmie-psychonaut-4-tired-numb-still-alive-2012-324067 if new_name.count(" - ") != 1: name = new_name return @@ -834,6 +835,27 @@ class Musify(Page): if _artist_name is not None or _artist_src is not None: artist_list.append(Artist(name=_artist_name, source_list=_artist_src)) + # playlist actions + playlist_actions: BeautifulSoup = song_card.find("div", {"class": "playlist__actions"}) + if playlist_actions is not None: + """ +
+ + + + +
+ """ + # getting the actual download link: + download_anchor = playlist_actions.find("a", {"itemprop": "audio"}) + if download_anchor is not None: + download_href = download_anchor.get("href") + if download_href is not None: + source_list.append(Source( + cls.SOURCE_TYPE, + adio_url=cls.HOST + download_href + )) + return Song( title=song_name, tracksort=tracksort,