From 0a8a96c5468f864ba9f0e8129508b41c772160b2 Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Tue, 20 Jun 2023 12:52:00 +0200 Subject: [PATCH] finished fetching of single song --- src/actual_donwload.py | 2 +- src/music_kraken/pages/musify.py | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/actual_donwload.py b/src/actual_donwload.py index ac8779e..bafae70 100644 --- a/src/actual_donwload.py +++ b/src/actual_donwload.py @@ -13,7 +13,7 @@ if __name__ == "__main__": ] fetch_musify_song = [ - "s: https://musify.club/track/linkin-park-numb-210765" + "s: https://musify.club/track/blokkmonsta-schwartz-crystal-f-purer-hass-8369115" ] youtube_search = [ diff --git a/src/music_kraken/pages/musify.py b/src/music_kraken/pages/musify.py index da1bb0c..e732969 100644 --- a/src/music_kraken/pages/musify.py +++ b/src/music_kraken/pages/musify.py @@ -397,7 +397,7 @@ class Musify(Page): def _parse_artist_anchor(artist_soup: BeautifulSoup): nonlocal artist_list - if artist_anchor is None: + if artist_soup is None: return artist_src_list = [] @@ -437,6 +437,22 @@ class Musify(Page): if href is not None: source.audio_url = self.HOST + href + # song detail + album_info: BeautifulSoup + for album_info in soup.find_all("ul", {"class": "album-info"}): + list_element: BeautifulSoup = album_info.find("li") + + if list_element is not None: + artist_soup: BeautifulSoup + for artist_soup in list_element.find_all("a"): + artist_source_list = [] + href = artist_soup["href"] + if href is not None: + artist_source_list = [Source(self.SOURCE_TYPE, self.HOST + href)] + artist_list.append(Artist( + name=artist_soup.text.strip(), + source_list=artist_source_list + )) # breadcrums breadcrumb_list_element_list: List[BeautifulSoup] = soup.find_all("ol", {"class": "breadcrumb"})