Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for lg webos tv #371

Merged
merged 10 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/rabilrbl/jiotv_go/v3

go 1.22
go 1.22.0
rabilrbl marked this conversation as resolved.
Show resolved Hide resolved

require (
github.com/BurntSushi/toml v1.4.0
Expand Down
6 changes: 4 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,9 @@ 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)
c.SendStream(strings.NewReader(m3uContent))
return nil
dheerajv4855 marked this conversation as resolved.
Show resolved Hide resolved

rabilrbl marked this conversation as resolved.
Show resolved Hide resolved
rabilrbl marked this conversation as resolved.
Show resolved Hide resolved
}

for i, channel := range apiResponse.Result {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
Name: "JioTV Go",
Usage: "Stream JioTV on any device",
HelpName: "jiotv_go",
Version: "v3.7.0",
Version: "v3.8.0",
dheerajv4855 marked this conversation as resolved.
Show resolved Hide resolved
Copyright: "© JioTV Go by Mohammed Rabil (https://github.com/rabilrbl/jiotv_go)",
Compiled: time.Now(),
Suggest: true,
Expand Down