fetching notes

This commit is contained in:
Hellow 2023-03-17 23:55:38 +01:00
parent 5d0f9814c8
commit 5bd9439104
2 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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)