diff --git a/development/actual_donwload.py b/development/actual_donwload.py index 548e228..65d07f9 100644 --- a/development/actual_donwload.py +++ b/development/actual_donwload.py @@ -6,9 +6,9 @@ logging.getLogger().setLevel(logging.DEBUG) if __name__ == "__main__": commands = [ - "s: #a Crystal F", - "10", - "2", + "s: #a Happy Days", + "7", + "9", ] diff --git a/music_kraken/pages/musify.py b/music_kraken/pages/musify.py index ebcb8e6..2a9fc8f 100644 --- a/music_kraken/pages/musify.py +++ b/music_kraken/pages/musify.py @@ -681,17 +681,20 @@ class Musify(Page): anchor: BeautifulSoup = artist_crumb.find("a") if anchor is not None: href = anchor.get("href") - artist_source_list: List[Source] = [] - if href is not None: - artist_source_list.append(Source(self.SOURCE_TYPE, self.HOST + href.strip())) + href_parts = href.split("/") + if not(len(href_parts) <= 1 or href_parts[-2] != "artist"): + artist_source_list: List[Source] = [] - span: BeautifulSoup = anchor.find("span") - if span is not None: - artist_list.append(Artist( - name=span.get_text(strip=True), - source_list=artist_source_list - )) + if href is not None: + artist_source_list.append(Source(self.SOURCE_TYPE, self.HOST + href.strip())) + + span: BeautifulSoup = anchor.find("span") + if span is not None: + artist_list.append(Artist( + name=span.get_text(strip=True), + source_list=artist_source_list + )) else: self.LOGGER.debug("there are not 4 breadcrumb items, which shouldn't be the case")