From c490b51423b803982e00f0a71260f764f0eebf6d Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Thu, 23 May 2024 19:10:06 +0800 Subject: [PATCH] Fix: proxy emby movie need parse source id (#172) --- server/handlers/movie.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/handlers/movie.go b/server/handlers/movie.go index b44921a..a53fad7 100644 --- a/server/handlers/movie.go +++ b/server/handlers/movie.go @@ -783,6 +783,10 @@ func ProxyMovie(ctx *gin.Context) { // } func proxyURL(ctx *gin.Context, u string, headers map[string]string) error { + if utils.GetUrlExtension(u) == "m3u8" { + ctx.Redirect(http.StatusFound, u) + return nil + } if !settings.AllowProxyToLocal.Get() { if l, err := utils.ParseURLIsLocalIP(u); err != nil { return fmt.Errorf("check url is local ip error: %w", err) @@ -1280,7 +1284,7 @@ func proxyVendorMovie(ctx *gin.Context, movie *op.Movie) { ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorStringResp("source out of range")) return } - id, err := strconv.Atoi(ctx.Query("id")) + id, err := strconv.Atoi(ctx.Query("source")) if err != nil { log.Errorf("proxy vendor movie error: %v", err) ctx.AbortWithStatusJSON(http.StatusBadRequest, model.NewApiErrorResp(err))