finished fetching of single song
This commit is contained in:
parent
d5717c9a6b
commit
0a8a96c546
@ -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 = [
|
||||
|
@ -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"})
|
||||
|
Loading…
Reference in New Issue
Block a user