handlers

package
v2.21.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: CC-BY-4.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EPG_POSTER_URL = "https://jiotv.catchup.cdn.jio.com/dare_images/shows/"
)
View Source
const (
	REFRESH_TOKEN_URL = "https://auth.media.jio.com/tokenservice/apis/v1/refreshtoken?langId=6"
)

Variables

View Source
var (
	TV               *television.Television
	DisableTSHandler = os.Getenv("JIOTV_DISABLE_TS_HANDLER") == "true"

	Title     string
	EnableDRM = os.Getenv("JIOTV_DRM") == "true"
	SONY_LIST = []string{"154", "155", "162", "289", "291", "471", "474", "476", "483", "514", "524", "525", "697", "872", "873", "874", "891", "892", "1146", "1393", "1772", "1773", "1774", "1775"}
)

Functions

func BpkProxyHandler added in v2.20.0

func BpkProxyHandler(c *fiber.Ctx) error

BpkProxyHandler handles BPK proxy routes /bpk/:channelID

func ChannelsHandler

func ChannelsHandler(c *fiber.Ctx) error

ChannelsHandler fetch all channels from JioTV API Also to generate M3U playlist

func ClapprHandler

func ClapprHandler(c *fiber.Ctx) error

ClapprHandler is previous (old) Web Player to stream live TV

func DASHTimeHandler added in v2.20.2

func DASHTimeHandler(c *fiber.Ctx) error

func DRMKeyHandler added in v2.20.0

func DRMKeyHandler(c *fiber.Ctx) error

DRMKeyHandler handles DRM key routes /drm?auth=xxx

func EPGHandler

func EPGHandler(c *fiber.Ctx) error

EPGHandler handles EPG requests

func ErrorMessageHandler

func ErrorMessageHandler(c *fiber.Ctx, err error) error

ErrorMessageHandler handles error messages Responds with 500 status code and error message

func FaviconHandler

func FaviconHandler(c *fiber.Ctx) error

FaviconHandler Responds for favicon.ico request

func ImageHandler

func ImageHandler(c *fiber.Ctx) error

ImageHandler loads image from JioTV server

func IndexHandler

func IndexHandler(c *fiber.Ctx) error

IndexHandler handles the index page for `/` route

func Init

func Init()

Init initializes the necessary operations required for the handlers to work.

func LiveHandler

func LiveHandler(c *fiber.Ctx) error

LiveHandler handles the live channel stream route `/live/:id.m3u8`.

func LiveMpdHandler added in v2.20.0

func LiveMpdHandler(c *fiber.Ctx) error

LiveMpdHandler handles live stream routes /mpd/:channelID

func LiveQualityHandler

func LiveQualityHandler(c *fiber.Ctx) error

LiveQualityHandler handles the live channel stream route `/live/:quality/:id.m3u8`.

func LoginPasswordHandler

func LoginPasswordHandler(c *fiber.Ctx) error

LoginPasswordHandler is used to login with password

func LoginRefreshAccessToken

func LoginRefreshAccessToken() error

LoginRefreshAccessToken Function is used to refresh AccessToken

func LoginSendOTPHandler

func LoginSendOTPHandler(c *fiber.Ctx) error

LoginSendOTPHandler sends OTP for login

func LoginVerifyOTPHandler

func LoginVerifyOTPHandler(c *fiber.Ctx) error

LoginVerifyOTPHandler verifies OTP and login

func LogoutHandler added in v2.15.19

func LogoutHandler(c *fiber.Ctx) error

LogoutHandler is used to logout

func PlayHandler

func PlayHandler(c *fiber.Ctx) error

PlayHandler loads HTML Page with video player iframe embedded with video URL URL is generated from the channel ID

func PlayerHandler

func PlayerHandler(c *fiber.Ctx) error

PlayerHandler loads Web Player to stream live TV

func PlaylistHandler

func PlaylistHandler(c *fiber.Ctx) error

PlaylistHandler is the route for generating M3U playlist only For user convenience, redirect to /channels?type=m3u

func PosterHandler added in v2.18.0

func PosterHandler(c *fiber.Ctx) error

PosterHandler loads image from JioTV server

func RefreshTokenIfExpired

func RefreshTokenIfExpired(credentials *utils.JIOTV_CREDENTIALS)

RefreshTokenIfExpired Function is used to handle AccessToken refresh

func RenderHandler

func RenderHandler(c *fiber.Ctx) error

RenderHandler handles M3U8 file for modification This handler shall replace JioTV server URLs with our own server URLs

func RenderKeyHandler

func RenderKeyHandler(c *fiber.Ctx) error

RenderKeyHandler requests m3u8 key from JioTV server

func RenderTSHandler

func RenderTSHandler(c *fiber.Ctx) error

RenderTSHandler loads TS file from JioTV server

func SLHandler added in v2.21.0

func SLHandler(c *fiber.Ctx) error

SLHandler proxies requests to SonyLiv CDN

func WebEPGHandler added in v2.18.0

func WebEPGHandler(c *fiber.Ctx) error

WebEPGHandler responds to requests for EPG data for individual channels.

Types

type LoginRequestBodyData

type LoginRequestBodyData struct {
	// Username or mobile number of Jio account
	Username string `json:"username" xml:"username" form:"username"`
	// Password of Jio account
	Password string `json:"password" xml:"password" form:"password"`
}

LoginRequestBodyData represents Request body for password based login request

type LoginSendOTPRequestBodyData

type LoginSendOTPRequestBodyData struct {
	// Mobile number of Jio account
	MobileNumber string `json:"number" xml:"number" form:"number"`
}

LoginSendOTPRequestBodyData represents Request body for OTP based login request

type LoginVerifyOTPRequestBodyData

type LoginVerifyOTPRequestBodyData struct {
	// Mobile number of Jio account
	MobileNumber string `json:"number" xml:"number" form:"number"`
	// OTP received on mobile number
	OTP string `json:"otp" xml:"otp" form:"otp"`
}

LoginVerifyOTPRequestBodyData represents Request body for OTP verification request

type RefreshTokenResponse

type RefreshTokenResponse struct {
	// Access token for JioTV API
	AccessToken string `json:"authToken"`
}

RefreshTokenResponse represents Response body for refresh token request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL