*
j3s j3s@c3f.net
Wed, 17 Mar 2021 18:06:49 -0500
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
main.go
→
main.go
@@ -71,13 +71,13 @@ list := strings.Join(keys, "\n")
e.Sender.Send(list) } var file string - matched, err := regexp.MatchString(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_0-9]{11}`, e.Message) + matched, err := regexp.MatchString(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_\-0-9]{11}`, e.Message) if err != nil { fmt.Printf("regex match blew up: %s", err) return } if matched && strings.HasPrefix(e.Message, "!") { - m := regexp.MustCompile(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_0-9]{11}`) + m := regexp.MustCompile(`https:\/\/(www.)?youtube\.com\/watch\?v=[A-z_\-0-9]{11}`) videoUrl := m.FindString(e.Message) fmt.Println("downloading...") parts := strings.Split(videoUrl, "?v=")