Recognise www Youtube URLs.
authorCMDR furrycat <elite@furrycat.net>
Tue, 28 Mar 2017 21:35:09 +0000 (22:35 +0100)
committerCMDR furrycat <elite@furrycat.net>
Tue, 28 Mar 2017 21:35:09 +0000 (22:35 +0100)
bot.py

diff --git a/bot.py b/bot.py
index 8a2187f..dbd0fc6 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -521,7 +521,7 @@ def voice_channel_for_user(user):
         return voice_channel
 
 async def create_player(voice, url):
-  if re.match(r'https?://youtu(?:\.be|be\.com)/', url):
+  if re.match(r'https?://(?:www\.)?youtu(?:\.be|be\.com)/', url):
     player = await voice.create_ytdl_player(url)
   else:
     player = voice.create_ffmpeg_player(url)