mirror of
https://github.com/pierre-emmanuelJ/iptv-proxy.git
synced 2026-03-18 07:49:27 +01:00
Xtream-API: Add /play url support
Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com>
This commit is contained in:
@@ -65,6 +65,7 @@ func (c *Config) xtreamRoutes(r *gin.RouterGroup) {
|
||||
r.GET(fmt.Sprintf("/series/%s/%s/:id", c.User, c.Password), c.xtreamStreamSeries)
|
||||
r.GET(fmt.Sprintf("/hlsr/:token/%s/%s/:channel/:hash/:chunk", c.User, c.Password), c.xtreamHlsrStream)
|
||||
r.GET("/hls/:token/:chunk", c.xtreamHlsStream)
|
||||
r.GET("/play/:token/:type", c.xtreamStreamPlay)
|
||||
}
|
||||
|
||||
func (c *Config) m3uRoutes(r *gin.RouterGroup) {
|
||||
|
||||
@@ -312,6 +312,18 @@ func (c *Config) xtreamStreamLive(ctx *gin.Context) {
|
||||
c.xtreamStream(ctx, rpURL)
|
||||
}
|
||||
|
||||
func (c *Config) xtreamStreamPlay(ctx *gin.Context) {
|
||||
hash := ctx.Param("hash")
|
||||
t := ctx.Param("type")
|
||||
rpURL, err := url.Parse(fmt.Sprintf("%s/play/%s/%s", c.XtreamBaseURL, hash, t))
|
||||
if err != nil {
|
||||
ctx.AbortWithError(http.StatusInternalServerError, err) // nolint: errcheck
|
||||
return
|
||||
}
|
||||
|
||||
c.xtreamStream(ctx, rpURL)
|
||||
}
|
||||
|
||||
func (c *Config) xtreamStreamTimeshift(ctx *gin.Context) {
|
||||
duration := ctx.Param("duration")
|
||||
start := ctx.Param("start")
|
||||
|
||||
Reference in New Issue
Block a user