Compare commits
4 commits
c5500bc7fa
...
186d3b3069
Author | SHA1 | Date | |
---|---|---|---|
186d3b3069 | |||
480eb86d80 | |||
1a87147fe0 | |||
fe9a0086bf |
2 changed files with 5 additions and 5 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,13 +100,13 @@ 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 {
|
||||
log.Println(err)
|
||||
continue
|
||||
} else {
|
||||
} else if result.Info.AgeLimit < 18 && ! result.Info.IsLive {
|
||||
/*
|
||||
videoChoice, audioChoice, err := getLargestDashFormat(result, 8*1024*1024)
|
||||
log.Printf("Choice: %s+%s | Size: %fM\n", videoChoice.FormatID, audioChoice.FormatID, (videoChoice.Filesize+audioChoice.Filesize)/1024/1024)
|
||||
|
@ -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