Skip to content

Commit

Permalink
PROPERLY fixed Genius' "Embed" thing at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
AtlasC0R3 committed Apr 3, 2022
1 parent 358e615 commit 22c9f2b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drop/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from .types import Search, Lyrics, UrbanDefinition
import aiohttp
import json
import re

GENIUS = None

Expand Down Expand Up @@ -117,7 +116,14 @@ async def lyrics(query: str):
song.title = song_result["title"]

extracted_lyrics = (await ext.genius_get_lyrics(song_path)).replace(f"{song.title} Lyrics", '')
extracted_lyrics = re.sub(r"([0-9]|[0-9][0-9])Embed", "", extracted_lyrics)
# extracted_lyrics = re.sub(r"([0-9]|[0-9][0-9])Embed", "", extracted_lyrics) Preliminary BS.

if extracted_lyrics.endswith('Embed'):
pyongs = song_result['pyongs_count']
if pyongs:
extracted_lyrics = extracted_lyrics.replace(f"{song_result['pyongs_count']}Embed", '')
else:
extracted_lyrics = extracted_lyrics[:-5]

song.lyrics = extracted_lyrics
song.artist = song_result["primary_artist"]["name"]
Expand Down

0 comments on commit 22c9f2b

Please sign in to comment.