Skip to content

Commit 0e03ca3

Browse files
authored
Merge pull request #5 from LosTigeros/patch-1
Update regex for proper url detection
2 parents 7db93c5 + 28f2a94 commit 0e03ca3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

youtube.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ registerPlugin({
301301
// !{command}[-{area}] [{text}]
302302
cmd: /^!(\w+)(?:-(\w+))?(?:\s(.+))?/,
303303
// {videId}
304-
youtube: /(?:http|https):\/\/www\.(?:youtube\.com|youtu\.be)\/watch\?v=([\w-]+)/
304+
youtube: /(?:http(?:s)??\:\/\/)?(?:www\.)?(?:(?:youtube\.com\/watch\?v=)|(?:youtu.be\/))([\w-]+)/
305305
},
306306
command_trigger: config.command_trigger || 'youtube',
307307
catch_url: config.yt_catchurl,

0 commit comments

Comments
 (0)