Skip to content

Commit

Permalink
regex fix for edgecase in yt link. Closes #64
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakkuzan committed Oct 27, 2023
1 parent dab402f commit 3362614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cogs/audio/wavelink_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async def search_tracks(self, search_phrase: str) -> tuple[list[wavelink.Playabl

# We need to extract vid id because wavelink does not support shortened links
video_id_regex = re.search(
r"youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?=]*)?", search_phrase
r"youtu(?:be\.com\/watch\?[^\s]*v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?=]*)?", search_phrase
)
if video_id_regex and video_id_regex.groups()[0]:
safe_url = f'https://www.youtube.com/watch?v={video_id_regex.groups()[0]}'
Expand Down

0 comments on commit 3362614

Please sign in to comment.