Skip to content

Commit

Permalink
fix for lg webos tv (#371)
Browse files Browse the repository at this point in the history
Co-authored-by: Mohammed Rabil <rabilrbl7@gmail.com>
Co-authored-by: Mohammed Rabil <mail@rabil.me>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dj <dj@djs-Mac-Pro.local>
  • Loading branch information
6 people authored Aug 23, 2024
1 parent 6df6b2d commit a6e11b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions cmd/jiotv_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions internal/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a6e11b2

Please sign in to comment.