From 5bd94391040dc9717c0ebd962387c4bffc4e0bfc Mon Sep 17 00:00:00 2001 From: Hellow Date: Fri, 17 Mar 2023 23:55:38 +0100 Subject: [PATCH] fetching notes --- src/music_kraken/pages/musify.py | 13 ++++++++++--- src/musify_search.py | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/music_kraken/pages/musify.py b/src/music_kraken/pages/musify.py index ea26bde..1dfe02f 100644 --- a/src/music_kraken/pages/musify.py +++ b/src/music_kraken/pages/musify.py @@ -588,7 +588,8 @@ class Musify(Page): """ name = "" source_list: List[Source] = [] - county = None + country = None + notes: FormattedText = None breadcrumbs: BeautifulSoup = soup.find("ol", {"class": "breadcrumb"}) if breadcrumbs is not None: @@ -645,11 +646,17 @@ class Musify(Page): country = pycountry.countries.get(alpha_2=list(country_set)[0]) + note_soup: BeautifulSoup = soup.find(id="text-main") + if note_soup is not None: + notes = FormattedText(html=note_soup.decode_contents()) + print(notes.plaintext) + return Artist( _id=url.musify_id, name=name, - country=county, - source_list=source_list + country=country, + source_list=source_list, + notes=notes ) @classmethod diff --git a/src/musify_search.py b/src/musify_search.py index 5811318..a6ed8ef 100644 --- a/src/musify_search.py +++ b/src/musify_search.py @@ -10,7 +10,7 @@ def search(): def fetch_artist(): artist = objects.Artist( name="Ghost Bath", - source_list=[objects.Source(objects.SourcePages.MUSIFY, "https://musify.club/artist/ghost-bath-280348")] + source_list=[objects.Source(objects.SourcePages.MUSIFY, "https://musify.club/artist/psychonaut-4-83193")] ) artist = Musify.fetch_details(artist)