Fix url regex and support more kinds of urls
This commit is contained in:
parent
a588cc67eb
commit
773a174007
1 changed files with 2 additions and 2 deletions
|
|
@ -287,8 +287,8 @@ class ArgonDJBot(yaboli.Bot):
|
||||||
|
|
||||||
# Find the video id in a single argument
|
# Find the video id in a single argument
|
||||||
VIDEO_ID_RE = r"[a-zA-Z0-9_-]{11}"
|
VIDEO_ID_RE = r"[a-zA-Z0-9_-]{11}"
|
||||||
YOUTUBE_RE = r"((https?://)?(www\.|music\.)?(youtube\.com/(watch\?(\S*&)v=|embed/)|youtu\.be/))?(" + VIDEO_ID_RE + ")"
|
YOUTUBE_RE = r"((https?://)?(www\.|music\.)?(youtube\.com/((watch|listen)\?(\S*&)?v=|embed/)|youtu\.be/))?(" + VIDEO_ID_RE + ")"
|
||||||
YOUTUBE_RE_GROUP = 7
|
YOUTUBE_RE_GROUP = 8
|
||||||
|
|
||||||
DEL_RE = r"(\d+)" # Per argument
|
DEL_RE = r"(\d+)" # Per argument
|
||||||
INS_RE = r"(before|after)\s+(\d+)\s+(.*)" # On the whole argstr
|
INS_RE = r"(before|after)\s+(\d+)\s+(.*)" # On the whole argstr
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue