all repos — fixyoutube-go @ 99d543cc2102abec08cf0a8250dc231a2059b8da

A better way to embed YouTube videos everywhere (inspired by FixTweet).

fix bad regex
Marco Andronaco andronacomarco@gmail.com
Fri, 12 Jan 2024 12:05:08 +0100
commit

99d543cc2102abec08cf0a8250dc231a2059b8da

parent

86cdbffea945847bad9ea82cd91edad7ef1360a9

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M fixyoutube.gofixyoutube.go

@@ -22,7 +22,7 @@ var logger = logrus.New()

var indexTemplate = template.Must(template.ParseFiles(templatesDirectory + "index.html")) var videoTemplate = template.Must(template.ParseFiles(templatesDirectory + "video.html")) var userAgentRegex = regexp.MustCompile(`(?i)bot|facebook|embed|got|firefox\/92|firefox\/38|curl|wget|go-http|yahoo|generator|whatsapp|preview|link|proxy|vkshare|images|analyzer|index|crawl|spider|python|cfnetwork|node`) -var videoRegex = regexp.MustCompile(`^(?i)[a-z0-9_-]{11}$`) +var videoRegex = regexp.MustCompile(`(?i)^[a-z0-9_-]{11}$`) var apiKey string