only get video/mp4 formats
Marco Andronaco andronacomarco@gmail.com
Tue, 15 Oct 2024 23:45:59 +0200
2 files changed,
2 insertions(+),
3 deletions(-)
M
src/app/handlers.go
→
src/app/handlers.go
@@ -6,7 +6,6 @@ "net/http"
"regexp" "strconv" "text/template" - "time" g "github.com/birabittoh/gopipe/src/globals" )@@ -14,7 +13,6 @@
const ( fmtYouTubeURL = "https://www.youtube.com/watch?v=%s" err500 = "Internal Server Error" - urlDuration = 6 * time.Hour ) var (
M
src/app/video.go
→
src/app/video.go
@@ -6,6 +6,7 @@ "fmt"
"log" "regexp" "strconv" + "strings" "time" g "github.com/birabittoh/gopipe/src/globals"@@ -45,7 +46,7 @@ return &formats[formatID%l]
} func formatsSelectFn(f youtube.Format) bool { - return f.AudioChannels > 1 && f.ContentLength < maxContentLength + return f.AudioChannels > 1 && f.ContentLength < maxContentLength && strings.HasPrefix(f.MimeType, "video/mp4") } func getURL(videoID string) string {