diff --git a/lyric_search/sources/genius.py b/lyric_search/sources/genius.py index 2265d4a..272d5a1 100644 --- a/lyric_search/sources/genius.py +++ b/lyric_search/sources/genius.py @@ -101,6 +101,10 @@ class Genius: html = BeautifulSoup(htm.unescape(scrape_text).replace('
', '\n'), "html.parser") + header_tags: Optional[ResultSet] = html.find_all(['h1', 'h2', 'h3', 'h4', 'h5', 'span']) + if header_tags: + for tag in header_tags: + tag.extract() divs: Optional[ResultSet] = html.find_all("div", {"data-lyrics-container": "true"}) if not divs: diff --git a/utils/radio_util.py b/utils/radio_util.py index 4f37f4d..1762b45 100644 --- a/utils/radio_util.py +++ b/utils/radio_util.py @@ -147,7 +147,7 @@ class RadioUtil: """ db_query: str = """SELECT distinct(LOWER(TRIM(artist)) || " - " || LOWER(TRIM(song))), (TRIM(artist) || " - " || TRIM(song)) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ - WHERE id >= 67166 AND (genre LIKE "%metalcore%"\ + WHERE (genre LIKE "%metalcore%"\ OR genre LIKE "%rock%"\ OR genre LIKE "%pop punk%"\ OR genre LIKE "%math rock%"\ @@ -187,14 +187,14 @@ class RadioUtil: """ # db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ - # WHERE genre like "%hip hop%" OR genre LIKE "%rap%" OR genre LIKE "%edm%" OR genre LIKE "%trap%"' + # WHERE artist LIKE "%tethered%" OR artist LIKE "%more of mysel%" ORDER BY artist DESC, album ASC, song ASC' """ LIMITED TO ONE/SOME ARTISTS... """ # db_query = 'SELECT distinct(artist || " - " || song) AS artistdashsong, id, artist, song, album, genre, file_path, duration FROM tracks\ - # WHERE (artist LIKE "%bayside%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%(live%%" AND NOT song LIKE "%%acoustic%%" AND NOT song LIKE "%%instrumental%%" AND NOT song LIKE "%%remix%%" AND NOT song LIKE "%%reimagined%%" AND NOT song LIKE "%%alternative%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY artist DESC, album DESC, id ASC' + # WHERE (artist LIKE "%sullivan king%" OR artist LIKE "%kayzo%" OR artist like "%kai wachi%" OR genre LIKE "%edm%" OR genre LIKE "%electronicore%") AND (NOT song LIKE "%%stripped%%" AND NOT song LIKE "%(2022)%" AND NOT song LIKE "%(live%%" AND NOT song LIKE "%%acoustic%%" AND NOT song LIKE "%%instrumental%%" AND NOT song LIKE "%%remix%%" AND NOT song LIKE "%%reimagined%%" AND NOT song LIKE "%%alternative%%" AND NOT song LIKE "%%unzipped%%") GROUP BY artistdashsong ORDER BY RANDOM()'# ORDER BY album ASC, id ASC' async with sqlite3.connect(self.active_playlist_path, timeout=2) as db_conn: