diff --git a/cmd/jiotv_go.go b/cmd/jiotv_go.go index e4ce306..6d5cd22 100644 --- a/cmd/jiotv_go.go +++ b/cmd/jiotv_go.go @@ -14,9 +14,7 @@ import ( "github.com/rabilrbl/jiotv_go/v3/web" "github.com/gofiber/fiber/v2" - "github.com/gofiber/fiber/v2/middleware/etag" "github.com/gofiber/fiber/v2/middleware/filesystem" - "github.com/gofiber/fiber/v2/middleware/helmet" "github.com/gofiber/fiber/v2/middleware/logger" "github.com/gofiber/fiber/v2/middleware/recover" "github.com/gofiber/template/html/v2" @@ -32,11 +30,10 @@ func JioTVServer(host, port, configPath string, prefork bool) error { if err := config.Cfg.Load(configPath); err != nil { return err } - + // Initialize the logger object utils.Log = utils.GetLogger() - // Initialize the store object if err := store.Init(); err != nil { return err @@ -88,12 +85,6 @@ func JioTVServer(host, port, configPath string, prefork bool) error { Browse: false, })) - // Helmet middleware to set security headers - app.Use(helmet.New()) - - // ETag middleware to set ETag header for caching - app.Use(etag.New()) - // Handle all /bpk-tv/* routes app.Use("/bpk-tv/", handlers.BpkProxyHandler) diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index adb1684..8739b9c 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -357,6 +357,7 @@ func RenderTSHandler(c *fiber.Ctx) error { // ChannelsHandler fetch all channels from JioTV API // Also to generate M3U playlist func ChannelsHandler(c *fiber.Ctx) error { + quality := strings.TrimSpace(c.Query("q")) splitCategory := strings.TrimSpace(c.Query("c")) languages := strings.TrimSpace(c.Query("l")) @@ -397,8 +398,7 @@ func ChannelsHandler(c *fiber.Ctx) error { // Set the Content-Disposition header for file download c.Set("Content-Disposition", "attachment; filename=jiotv_playlist.m3u") c.Set("Content-Type", "application/vnd.apple.mpegurl") // Set the video M3U MIME type - c.Response().Header.Set("Cache-Control", "public, max-age=3600") - return c.SendString(m3uContent) + return c.SendStream(strings.NewReader(m3uContent)) } for i, channel := range apiResponse.Result {