cosmetics

This commit is contained in:
nikk gitanes
2024-04-12 05:12:51 +03:00
parent ecce45695b
commit b4e6281c5c
8 changed files with 46 additions and 49 deletions

View File

@@ -466,15 +466,13 @@ const docTemplate = `{
"type": "string", "type": "string",
"description": "Set title of torrent", "description": "Set title of torrent",
"name": "title", "name": "title",
"in": "query", "in": "query"
"required": true
}, },
{ {
"type": "string", "type": "string",
"description": "Set poster link of torrent", "description": "Set poster link of torrent",
"name": "poster", "name": "poster",
"in": "query", "in": "query"
"required": true
}, },
{ {
"type": "string", "type": "string",

View File

@@ -459,15 +459,13 @@
"type": "string", "type": "string",
"description": "Set title of torrent", "description": "Set title of torrent",
"name": "title", "name": "title",
"in": "query", "in": "query"
"required": true
}, },
{ {
"type": "string", "type": "string",
"description": "Set poster link of torrent", "description": "Set poster link of torrent",
"name": "poster", "name": "poster",
"in": "query", "in": "query"
"required": true
}, },
{ {
"type": "string", "type": "string",

View File

@@ -603,12 +603,10 @@ paths:
- description: Set title of torrent - description: Set title of torrent
in: query in: query
name: title name: title
required: true
type: string type: string
- description: Set poster link of torrent - description: Set poster link of torrent
in: query in: query
name: poster name: poster
required: true
type: string type: string
- description: 'Set category of torrent, used in web: movie, tv, music, other' - description: 'Set category of torrent, used in web: movie, tv, music, other'
in: query in: query

View File

@@ -43,8 +43,8 @@ import (
// @Param m3u query string false "Get torrent as M3U playlist" // @Param m3u query string false "Get torrent as M3U playlist"
// @Param fromlast query string false "Get M3U from last played file" // @Param fromlast query string false "Get M3U from last played file"
// @Param play query string false "Start stream torrent" // @Param play query string false "Start stream torrent"
// @Param title query string true "Set title of torrent" // @Param title query string false "Set title of torrent"
// @Param poster query string true "Set poster link of torrent" // @Param poster query string false "Set poster link of torrent"
// @Param category query string false "Set category of torrent, used in web: movie, tv, music, other" // @Param category query string false "Set category of torrent, used in web: movie, tv, music, other"
// //
// @Produce application/octet-stream // @Produce application/octet-stream
@@ -61,9 +61,10 @@ func stream(c *gin.Context) {
_, play := c.GetQuery("play") _, play := c.GetQuery("play")
title := c.Query("title") title := c.Query("title")
poster := c.Query("poster") poster := c.Query("poster")
category, _ := c.GetQuery("category") category := c.Query("category")
data := "" data := ""
notAuth := c.GetBool("auth_required") && c.GetString(gin.AuthUserKey) == "" notAuth := c.GetBool("auth_required") && c.GetString(gin.AuthUserKey) == ""
if notAuth && (play || m3u) { if notAuth && (play || m3u) {
@@ -81,9 +82,10 @@ func stream(c *gin.Context) {
return return
} }
title, _ = url.QueryUnescape(title)
link, _ = url.QueryUnescape(link) link, _ = url.QueryUnescape(link)
title, _ = url.QueryUnescape(title)
poster, _ = url.QueryUnescape(poster) poster, _ = url.QueryUnescape(poster)
category, _ = url.QueryUnescape(category)
spec, err := utils.ParseLink(link) spec, err := utils.ParseLink(link)
if err != nil { if err != nil {
@@ -172,9 +174,10 @@ func streamNoAuth(c *gin.Context) {
_, play := c.GetQuery("play") _, play := c.GetQuery("play")
title := c.Query("title") title := c.Query("title")
poster := c.Query("poster") poster := c.Query("poster")
data := ""
category := c.Query("category") category := c.Query("category")
data := ""
if link == "" { if link == "" {
c.AbortWithError(http.StatusBadRequest, errors.New("link should not be empty")) c.AbortWithError(http.StatusBadRequest, errors.New("link should not be empty"))
return return

View File

@@ -118,20 +118,20 @@ var Mstile150x150png []byte
//go:embed pages/site.webmanifest //go:embed pages/site.webmanifest
var Sitewebmanifest []byte var Sitewebmanifest []byte
//go:embed pages/static/js/2.63f74d95.chunk.js //go:embed pages/static/js/2.15e75e72.chunk.js
var Staticjs263f74d95chunkjs []byte var Staticjs215e75e72chunkjs []byte
//go:embed pages/static/js/2.63f74d95.chunk.js.LICENSE.txt //go:embed pages/static/js/2.15e75e72.chunk.js.LICENSE.txt
var Staticjs263f74d95chunkjsLICENSEtxt []byte var Staticjs215e75e72chunkjsLICENSEtxt []byte
//go:embed pages/static/js/2.63f74d95.chunk.js.map //go:embed pages/static/js/2.15e75e72.chunk.js.map
var Staticjs263f74d95chunkjsmap []byte var Staticjs215e75e72chunkjsmap []byte
//go:embed pages/static/js/main.96201d04.chunk.js //go:embed pages/static/js/main.714fb205.chunk.js
var Staticjsmain96201d04chunkjs []byte var Staticjsmain714fb205chunkjs []byte
//go:embed pages/static/js/main.96201d04.chunk.js.map //go:embed pages/static/js/main.714fb205.chunk.js.map
var Staticjsmain96201d04chunkjsmap []byte var Staticjsmain714fb205chunkjsmap []byte
//go:embed pages/static/js/runtime-main.f542387e.js //go:embed pages/static/js/runtime-main.f542387e.js
var Staticjsruntimemainf542387ejs []byte var Staticjsruntimemainf542387ejs []byte

View File

@@ -1,17 +1,17 @@
{ {
"files": { "files": {
"main.js": "/static/js/main.96201d04.chunk.js", "main.js": "/static/js/main.714fb205.chunk.js",
"main.js.map": "/static/js/main.96201d04.chunk.js.map", "main.js.map": "/static/js/main.714fb205.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.f542387e.js", "runtime-main.js": "/static/js/runtime-main.f542387e.js",
"runtime-main.js.map": "/static/js/runtime-main.f542387e.js.map", "runtime-main.js.map": "/static/js/runtime-main.f542387e.js.map",
"static/js/2.63f74d95.chunk.js": "/static/js/2.63f74d95.chunk.js", "static/js/2.15e75e72.chunk.js": "/static/js/2.15e75e72.chunk.js",
"static/js/2.63f74d95.chunk.js.map": "/static/js/2.63f74d95.chunk.js.map", "static/js/2.15e75e72.chunk.js.map": "/static/js/2.15e75e72.chunk.js.map",
"index.html": "/index.html", "index.html": "/index.html",
"static/js/2.63f74d95.chunk.js.LICENSE.txt": "/static/js/2.63f74d95.chunk.js.LICENSE.txt" "static/js/2.15e75e72.chunk.js.LICENSE.txt": "/static/js/2.15e75e72.chunk.js.LICENSE.txt"
}, },
"entrypoints": [ "entrypoints": [
"static/js/runtime-main.f542387e.js", "static/js/runtime-main.f542387e.js",
"static/js/2.63f74d95.chunk.js", "static/js/2.15e75e72.chunk.js",
"static/js/main.96201d04.chunk.js" "static/js/main.714fb205.chunk.js"
] ]
} }

File diff suppressed because one or more lines are too long

View File

@@ -280,46 +280,46 @@ func RouteWebPages(route gin.IRouter) {
c.Data(200, "application/manifest+json", Sitewebmanifest) c.Data(200, "application/manifest+json", Sitewebmanifest)
}) })
route.GET("/static/js/2.63f74d95.chunk.js", func(c *gin.Context) { route.GET("/static/js/2.15e75e72.chunk.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs263f74d95chunkjs)) etag := fmt.Sprintf("%x", md5.Sum(Staticjs215e75e72chunkjs))
c.Header("Cache-Control", "public, max-age=31536000") c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag) c.Header("ETag", etag)
c.Data(200, "text/javascript; charset=utf-8", Staticjs263f74d95chunkjs) c.Data(200, "application/javascript; charset=utf-8", Staticjs215e75e72chunkjs)
}) })
route.GET("/static/js/2.63f74d95.chunk.js.LICENSE.txt", func(c *gin.Context) { route.GET("/static/js/2.15e75e72.chunk.js.LICENSE.txt", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs263f74d95chunkjsLICENSEtxt)) etag := fmt.Sprintf("%x", md5.Sum(Staticjs215e75e72chunkjsLICENSEtxt))
c.Header("Cache-Control", "public, max-age=31536000") c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag) c.Header("ETag", etag)
c.Data(200, "text/plain; charset=utf-8", Staticjs263f74d95chunkjsLICENSEtxt) c.Data(200, "text/plain; charset=utf-8", Staticjs215e75e72chunkjsLICENSEtxt)
}) })
route.GET("/static/js/2.63f74d95.chunk.js.map", func(c *gin.Context) { route.GET("/static/js/2.15e75e72.chunk.js.map", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjs263f74d95chunkjsmap)) etag := fmt.Sprintf("%x", md5.Sum(Staticjs215e75e72chunkjsmap))
c.Header("Cache-Control", "public, max-age=31536000") c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag) c.Header("ETag", etag)
c.Data(200, "application/json", Staticjs263f74d95chunkjsmap) c.Data(200, "application/json", Staticjs215e75e72chunkjsmap)
}) })
route.GET("/static/js/main.96201d04.chunk.js", func(c *gin.Context) { route.GET("/static/js/main.714fb205.chunk.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain96201d04chunkjs)) etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain714fb205chunkjs))
c.Header("Cache-Control", "public, max-age=31536000") c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag) c.Header("ETag", etag)
c.Data(200, "text/javascript; charset=utf-8", Staticjsmain96201d04chunkjs) c.Data(200, "application/javascript; charset=utf-8", Staticjsmain714fb205chunkjs)
}) })
route.GET("/static/js/main.96201d04.chunk.js.map", func(c *gin.Context) { route.GET("/static/js/main.714fb205.chunk.js.map", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain96201d04chunkjsmap)) etag := fmt.Sprintf("%x", md5.Sum(Staticjsmain714fb205chunkjsmap))
c.Header("Cache-Control", "public, max-age=31536000") c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag) c.Header("ETag", etag)
c.Data(200, "application/json", Staticjsmain96201d04chunkjsmap) c.Data(200, "application/json", Staticjsmain714fb205chunkjsmap)
}) })
route.GET("/static/js/runtime-main.f542387e.js", func(c *gin.Context) { route.GET("/static/js/runtime-main.f542387e.js", func(c *gin.Context) {
etag := fmt.Sprintf("%x", md5.Sum(Staticjsruntimemainf542387ejs)) etag := fmt.Sprintf("%x", md5.Sum(Staticjsruntimemainf542387ejs))
c.Header("Cache-Control", "public, max-age=31536000") c.Header("Cache-Control", "public, max-age=31536000")
c.Header("ETag", etag) c.Header("ETag", etag)
c.Data(200, "text/javascript; charset=utf-8", Staticjsruntimemainf542387ejs) c.Data(200, "application/javascript; charset=utf-8", Staticjsruntimemainf542387ejs)
}) })
route.GET("/static/js/runtime-main.f542387e.js.map", func(c *gin.Context) { route.GET("/static/js/runtime-main.f542387e.js.map", func(c *gin.Context) {