mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
add play link
This commit is contained in:
@@ -30,6 +30,9 @@ func SetupRoute(route *gin.RouterGroup) {
|
|||||||
route.GET("/stream", stream)
|
route.GET("/stream", stream)
|
||||||
route.GET("/stream/*fname", stream)
|
route.GET("/stream/*fname", stream)
|
||||||
|
|
||||||
|
route.HEAD("/play/:hash/:id", play)
|
||||||
|
route.GET("/play/:hash/:id", play)
|
||||||
|
|
||||||
route.POST("/viewed", viewed)
|
route.POST("/viewed", viewed)
|
||||||
|
|
||||||
route.GET("/playlistall/all.m3u", allPlayList)
|
route.GET("/playlistall/all.m3u", allPlayList)
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ func BasicAuth(accounts gin.Accounts) gin.HandlerFunc {
|
|||||||
user, found := pairs.searchCredential(c.Request.Header.Get("Authorization"))
|
user, found := pairs.searchCredential(c.Request.Header.Get("Authorization"))
|
||||||
if !found {
|
if !found {
|
||||||
if strings.HasPrefix(c.FullPath(), "/stream") ||
|
if strings.HasPrefix(c.FullPath(), "/stream") ||
|
||||||
|
strings.HasPrefix(c.FullPath(), "/play") ||
|
||||||
(strings.HasPrefix(c.FullPath(), "/playlist") && c.FullPath() != "/playlistall/all.m3u") {
|
(strings.HasPrefix(c.FullPath(), "/playlist") && c.FullPath() != "/playlistall/all.m3u") {
|
||||||
c.Set("not_auth", true)
|
c.Set("not_auth", true)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user