mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 06:53:27 +01:00
Fix falso positive lyric pages for Tekstowo
This commit is contained in:
parent
2fa2d1b4ee
commit
31f4df3ff3
1 changed files with 12 additions and 2 deletions
|
|
@ -416,12 +416,16 @@ class Tekstowo(Backend):
|
|||
|
||||
def fetch(self, artist, title):
|
||||
url = self.build_url(title, artist)
|
||||
print(url)
|
||||
search_results = self.fetch_url(url)
|
||||
song_page_url = self.parse_search_results(search_results)
|
||||
|
||||
if not song_page_url:
|
||||
return None
|
||||
|
||||
print('--------------------')
|
||||
print(song_page_url)
|
||||
|
||||
song_page_html = self.fetch_url(song_page_url)
|
||||
return self.extract_lyrics(song_page_html)
|
||||
|
||||
|
|
@ -437,8 +441,14 @@ class Tekstowo(Backend):
|
|||
except HTMLParseError:
|
||||
return None
|
||||
|
||||
song_row = html.find("div", class_="content"). \
|
||||
find_all("div", class_="box-przeboje")[0]
|
||||
song_rows = html.find("div", class_="content"). \
|
||||
find("div", class_="card"). \
|
||||
find_all("div", class_="box-przeboje")
|
||||
|
||||
if len(song_rows) < 1:
|
||||
return None
|
||||
|
||||
song_row = song_rows[0]
|
||||
|
||||
if not song_row:
|
||||
return None
|
||||
|
|
|
|||
Loading…
Reference in a new issue