feat: Update player API to use id_type in path

All Russian players now use format: /players/{player}/{id_type}/{id}
- id_type can be kp (Kinopoisk) or imdb
- Alloha, Lumex, Vibix, HDVB support both ID types
- Added validation for id_type parameter
- Updated handlers to parse id_type from path
This commit is contained in:
2025-10-18 20:21:13 +00:00
parent 43ca411897
commit b5d9f3c57d
12 changed files with 835 additions and 85 deletions

View File

@@ -25,6 +25,9 @@ type Config struct {
FrontendURL string
VibixHost string
VibixToken string
KPAPIKey string
HDVBToken string
KPAPIBaseURL string
}
func New() *Config {
@@ -50,6 +53,9 @@ func New() *Config {
FrontendURL: getEnv(EnvFrontendURL, ""),
VibixHost: getEnv(EnvVibixHost, DefaultVibixHost),
VibixToken: getEnv(EnvVibixToken, ""),
KPAPIKey: getEnv(EnvKPAPIKey, ""),
HDVBToken: getEnv(EnvHDVBToken, ""),
KPAPIBaseURL: getEnv("KPAPI_BASE_URL", DefaultKPAPIBase),
}
}

View File

@@ -20,6 +20,8 @@ const (
EnvFrontendURL = "FRONTEND_URL"
EnvVibixHost = "VIBIX_HOST"
EnvVibixToken = "VIBIX_TOKEN"
EnvKPAPIKey = "KPAPI_KEY"
EnvHDVBToken = "HDVB_TOKEN"
// Default values
DefaultJWTSecret = "your-secret-key"
@@ -29,6 +31,7 @@ const (
DefaultRedAPIBase = "http://redapi.cfhttp.top"
DefaultMongoDBName = "database"
DefaultVibixHost = "https://vibix.org"
DefaultKPAPIBase = "https://kinopoiskapiunofficial.tech/api"
// Static constants
TMDBImageBaseURL = "https://image.tmdb.org/t/p"