Compare commits

..

No commits in common. "186d3b306964aadbb13af6d3f3950ad4db781106" and "c5500bc7fa79efcef706d55fe6a33b0f7eb36e2b" have entirely different histories.

2 changed files with 5 additions and 5 deletions

View file

@ -101,7 +101,7 @@ func getLargestYTFormat(input goutubedl.Result, sizeLimit float64) (format goutu
} else {
size = input.Formats()[i].Filesize
}
if size <= sizeLimit && input.Formats()[i].FormatID != "17" {
if size <= sizeLimit {
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("\n<%s>", regexp.MustCompile("http.*twitter.com").ReplaceAllString(url, "https://nitter.pussthecat.org"))
response.Content = response.Content + fmt.Sprintf("<%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("\n<%s>", regexp.MustCompile("http.*youtube\\.com").ReplaceAllString(url, "https://piped.kavin.rocks"))
response.Content = response.Content + fmt.Sprintf("<%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 if result.Info.AgeLimit < 18 && ! result.Info.IsLive {
} else {
/*
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("\n%s", regexp.MustCompile("http.*instagram\\.com").ReplaceAllString(url, "https://bibliogram.art"))
response.Content = response.Content + fmt.Sprintf("<%s>", regexp.MustCompile("http.*instagram\\.com").ReplaceAllString(url, "https://bibliogram.art"))
result, err := goutubedl.New(context.Background(), url, goutubedl.Options{})
if err != nil {