Skip to content

Commit 2360a36

Browse files
author
trinity-aml
committed
update
1 parent bba064a commit 2360a36

14 files changed

Lines changed: 214 additions & 73 deletions

File tree

server/config/config.go

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package config
22

3-
import "github.com/ilyakaznacheev/cleanenv"
3+
import (
4+
"github.com/ilyakaznacheev/cleanenv"
5+
"math/rand"
6+
"time"
7+
)
48

59
type ConfParser struct {
610
Trackers []string `yaml:"trackers"`
@@ -9,6 +13,33 @@ type ConfParser struct {
913
Api_key string `yaml:"api_key"`
1014
}
1115

16+
var defApiKey = []string{
17+
"fb7bb23f03b6994dafc674c074d01761",
18+
"e55425032d3d0f371fc776f302e7c09b",
19+
"8301a21598f8b45668d5711a814f01f6",
20+
"8cf43ad9c085135b9479ad5cf6bbcbda",
21+
"da63548086e399ffc910fbc08526df05",
22+
"13e53ff644a8bd4ba37b3e1044ad24f3",
23+
"269890f657dddf4635473cf4cf456576",
24+
"a2f888b27315e62e471b2d587048f32e",
25+
"8476a7ab80ad76f0936744df0430e67c",
26+
"5622cafbfe8f8cfe358a29c53e19bba0",
27+
"ae4bd1b6fce2a5648671bfc171d15ba4",
28+
"257654f35e3dff105574f97fb4b97035",
29+
"2f4038e83265214a0dcd6ec2eb3276f5",
30+
"9e43f45f94705cc8e1d5a0400d19a7b7",
31+
"af6887753365e14160254ac7f4345dd2",
32+
"06f10fc8741a672af455421c239a1ffc",
33+
"fb7bb23f03b6994dafc674c074d01761",
34+
"09ad8ace66eec34302943272db0e8d2c",
35+
}
36+
37+
func RandApiKey() string {
38+
a := len(defApiKey)
39+
rand.Seed(time.Now().UnixNano())
40+
return defApiKey[rand.Intn(a)]
41+
}
42+
1243
var cfg ConfParser
1344

1445
func ReadConfigParser(vars string) ([]string, error) {

server/docs/docs.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ const docTemplate = `{
677677
"properties": {
678678
"cacheSize": {
679679
"description": "Cache",
680-
"type": "integer"
680+
"type": "integer",
681+
"format": "int64"
681682
},
682683
"connectionsLimit": {
683684
"type": "integer"
@@ -794,10 +795,12 @@ const docTemplate = `{
794795
"type": "object",
795796
"properties": {
796797
"capacity": {
797-
"type": "integer"
798+
"type": "integer",
799+
"format": "int64"
798800
},
799801
"filled": {
800-
"type": "integer"
802+
"type": "integer",
803+
"format": "int64"
801804
},
802805
"hash": {
803806
"type": "string"
@@ -812,7 +815,8 @@ const docTemplate = `{
812815
"type": "integer"
813816
},
814817
"piecesLength": {
815-
"type": "integer"
818+
"type": "integer",
819+
"format": "int64"
816820
},
817821
"readers": {
818822
"type": "array",
@@ -835,13 +839,15 @@ const docTemplate = `{
835839
"type": "integer"
836840
},
837841
"length": {
838-
"type": "integer"
842+
"type": "integer",
843+
"format": "int64"
839844
},
840845
"priority": {
841846
"type": "integer"
842847
},
843848
"size": {
844-
"type": "integer"
849+
"type": "integer",
850+
"format": "int64"
845851
}
846852
}
847853
},

server/docs/swagger.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,8 @@
670670
"properties": {
671671
"cacheSize": {
672672
"description": "Cache",
673-
"type": "integer"
673+
"type": "integer",
674+
"format": "int64"
674675
},
675676
"connectionsLimit": {
676677
"type": "integer"
@@ -787,10 +788,12 @@
787788
"type": "object",
788789
"properties": {
789790
"capacity": {
790-
"type": "integer"
791+
"type": "integer",
792+
"format": "int64"
791793
},
792794
"filled": {
793-
"type": "integer"
795+
"type": "integer",
796+
"format": "int64"
794797
},
795798
"hash": {
796799
"type": "string"
@@ -805,7 +808,8 @@
805808
"type": "integer"
806809
},
807810
"piecesLength": {
808-
"type": "integer"
811+
"type": "integer",
812+
"format": "int64"
809813
},
810814
"readers": {
811815
"type": "array",
@@ -828,13 +832,15 @@
828832
"type": "integer"
829833
},
830834
"length": {
831-
"type": "integer"
835+
"type": "integer",
836+
"format": "int64"
832837
},
833838
"priority": {
834839
"type": "integer"
835840
},
836841
"size": {
837-
"type": "integer"
842+
"type": "integer",
843+
"format": "int64"
838844
}
839845
}
840846
},

server/docs/swagger.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ definitions:
8383
properties:
8484
cacheSize:
8585
description: Cache
86+
format: int64
8687
type: integer
8788
connectionsLimit:
8889
type: integer
@@ -166,8 +167,10 @@ definitions:
166167
state.CacheState:
167168
properties:
168169
capacity:
170+
format: int64
169171
type: integer
170172
filled:
173+
format: int64
171174
type: integer
172175
hash:
173176
type: string
@@ -178,6 +181,7 @@ definitions:
178181
piecesCount:
179182
type: integer
180183
piecesLength:
184+
format: int64
181185
type: integer
182186
readers:
183187
items:
@@ -193,10 +197,12 @@ definitions:
193197
id:
194198
type: integer
195199
length:
200+
format: int64
196201
type: integer
197202
priority:
198203
type: integer
199204
size:
205+
format: int64
200206
type: integer
201207
type: object
202208
state.ReaderState:

server/poster/poster.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ func getUtil(str string, tv bool, movie bool, y int) string {
113113
var year_1 = 0
114114
var year_2 = 0
115115

116-
tmdbClient, err := tmdb.Init(config.ReadConfigParser2("Api_key"))
116+
api_key := config.ReadConfigParser2("Api_key")
117+
if api_key == "" {
118+
api_key = config.RandApiKey()
119+
}
120+
121+
tmdbClient, err := tmdb.Init(api_key)
117122

118123
if err != nil {
119124
fmt.Println(err)

server/web/pages/template/html.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,20 @@ var Mstile150x150png []byte
118118
//go:embed pages/site.webmanifest
119119
var Sitewebmanifest []byte
120120

121-
//go:embed pages/static/js/2.bd5fab89.chunk.js
122-
var Staticjs2bd5fab89chunkjs []byte
121+
//go:embed pages/static/js/2.e3863fa5.chunk.js
122+
var Staticjs2e3863fa5chunkjs []byte
123123

124-
//go:embed pages/static/js/2.bd5fab89.chunk.js.LICENSE.txt
125-
var Staticjs2bd5fab89chunkjsLICENSEtxt []byte
124+
//go:embed pages/static/js/2.e3863fa5.chunk.js.LICENSE.txt
125+
var Staticjs2e3863fa5chunkjsLICENSEtxt []byte
126126

127-
//go:embed pages/static/js/2.bd5fab89.chunk.js.map
128-
var Staticjs2bd5fab89chunkjsmap []byte
127+
//go:embed pages/static/js/2.e3863fa5.chunk.js.map
128+
var Staticjs2e3863fa5chunkjsmap []byte
129129

130-
//go:embed pages/static/js/main.66bf83d9.chunk.js
131-
var Staticjsmain66bf83d9chunkjs []byte
130+
//go:embed pages/static/js/main.72310489.chunk.js
131+
var Staticjsmain72310489chunkjs []byte
132132

133-
//go:embed pages/static/js/main.66bf83d9.chunk.js.map
134-
var Staticjsmain66bf83d9chunkjsmap []byte
133+
//go:embed pages/static/js/main.72310489.chunk.js.map
134+
var Staticjsmain72310489chunkjsmap []byte
135135

136136
//go:embed pages/static/js/runtime-main.b61e6409.js
137137
var Staticjsruntimemainb61e6409js []byte
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"files": {
3-
"main.js": "./static/js/main.66bf83d9.chunk.js",
4-
"main.js.map": "./static/js/main.66bf83d9.chunk.js.map",
3+
"main.js": "./static/js/main.72310489.chunk.js",
4+
"main.js.map": "./static/js/main.72310489.chunk.js.map",
55
"runtime-main.js": "./static/js/runtime-main.b61e6409.js",
66
"runtime-main.js.map": "./static/js/runtime-main.b61e6409.js.map",
7-
"static/js/2.bd5fab89.chunk.js": "./static/js/2.bd5fab89.chunk.js",
8-
"static/js/2.bd5fab89.chunk.js.map": "./static/js/2.bd5fab89.chunk.js.map",
7+
"static/js/2.e3863fa5.chunk.js": "./static/js/2.e3863fa5.chunk.js",
8+
"static/js/2.e3863fa5.chunk.js.map": "./static/js/2.e3863fa5.chunk.js.map",
99
"index.html": "./index.html",
10-
"static/js/2.bd5fab89.chunk.js.LICENSE.txt": "./static/js/2.bd5fab89.chunk.js.LICENSE.txt"
10+
"static/js/2.e3863fa5.chunk.js.LICENSE.txt": "./static/js/2.e3863fa5.chunk.js.LICENSE.txt"
1111
},
1212
"entrypoints": [
1313
"static/js/runtime-main.b61e6409.js",
14-
"static/js/2.bd5fab89.chunk.js",
15-
"static/js/main.66bf83d9.chunk.js"
14+
"static/js/2.e3863fa5.chunk.js",
15+
"static/js/main.72310489.chunk.js"
1616
]
1717
}

server/web/pages/template/pages/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

server/web/pages/template/pages/static/js/2.0c53e6a1.chunk.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

server/web/pages/template/pages/static/js/2.0c53e6a1.chunk.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)