Links are now separated by a newline
This commit is contained in:
parent
fe9a0086bf
commit
1a87147fe0
2 changed files with 4 additions and 4 deletions
|
@ -101,7 +101,7 @@ func getLargestYTFormat(input goutubedl.Result, sizeLimit float64) (format goutu
|
|||
} else {
|
||||
size = input.Formats()[i].Filesize
|
||||
}
|
||||
if size <= sizeLimit {
|
||||
if size <= sizeLimit && input.Formats()[i].FormatID != 17 {
|
||||
return input.Formats()[i], nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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{})
|
||||
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{})
|
||||
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 {
|
||||
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{})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue