Links are now separated by a newline

This commit is contained in:
Logan G 2022-07-20 15:06:07 -06:00
parent fe9a0086bf
commit 1a87147fe0
Signed by: logan
GPG key ID: E328528C921E7A7A
2 changed files with 4 additions and 4 deletions

View file

@ -101,7 +101,7 @@ func getLargestYTFormat(input goutubedl.Result, sizeLimit float64) (format goutu
} else { } else {
size = input.Formats()[i].Filesize size = input.Formats()[i].Filesize
} }
if size <= sizeLimit { if size <= sizeLimit && input.Formats()[i].FormatID != 17 {
return input.Formats()[i], nil return input.Formats()[i], nil
} }
} }

View file

@ -50,7 +50,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
} }
} }
response.Content = response.Content + fmt.Sprintf("<%s>", regexp.MustCompile("http.*twitter.com").ReplaceAllString(url, "https://nitter.pussthecat.org")) response.Content = response.Content + fmt.Sprintf("\n<%s>", regexp.MustCompile("http.*twitter.com").ReplaceAllString(url, "https://nitter.pussthecat.org"))
result, err := goutubedl.New(context.Background(), url, goutubedl.Options{}) result, err := goutubedl.New(context.Background(), url, goutubedl.Options{})
if err != nil { if err != nil {
@ -100,7 +100,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
} }
} }
response.Content = response.Content + fmt.Sprintf("<%s>", regexp.MustCompile("http.*youtube\\.com").ReplaceAllString(url, "https://piped.kavin.rocks")) response.Content = response.Content + fmt.Sprintf("\n<%s>", regexp.MustCompile("http.*youtube\\.com").ReplaceAllString(url, "https://piped.kavin.rocks"))
result, err := goutubedl.New(context.Background(), url, goutubedl.Options{}) result, err := goutubedl.New(context.Background(), url, goutubedl.Options{})
if err != nil { if err != nil {
@ -141,7 +141,7 @@ func messageCreate(session *discordgo.Session, message *discordgo.MessageCreate)
} else if output, _ := regexp.MatchString("(http.*instagram\\.com/p/.*)|(http.*instagram\\.com/tv/.*)|(http.*instagram\\.com/reel/.*)", url); output { } else if output, _ := regexp.MatchString("(http.*instagram\\.com/p/.*)|(http.*instagram\\.com/tv/.*)|(http.*instagram\\.com/reel/.*)", url); output {
log.Println("Instagram detected.") log.Println("Instagram detected.")
response.Content = response.Content + fmt.Sprintf("%s", regexp.MustCompile("http.*instagram\\.com").ReplaceAllString(url, "https://bibliogram.art")) response.Content = response.Content + fmt.Sprintf("\n%s", regexp.MustCompile("http.*instagram\\.com").ReplaceAllString(url, "https://bibliogram.art"))
result, err := goutubedl.New(context.Background(), url, goutubedl.Options{}) result, err := goutubedl.New(context.Background(), url, goutubedl.Options{})
if err != nil { if err != nil {