mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-28 01:48:51 +05:00
feat(players): build Lumex URL as portal.lumex.host/api/short?api_token=...&kinopoisk_id=... (or imdb_id)
This commit is contained in:
@@ -166,6 +166,9 @@ func (h *PlayersHandler) GetLumexPlayer(w http.ResponseWriter, r *http.Request)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Формируем запрос вида: https://portal.lumex.host/api/short?api_token=...&kinopoisk_id=...
|
||||||
|
// Ожидается, что LUMEX_URL уже содержит базовый URL и api_token, например:
|
||||||
|
// LUMEX_URL=https://portal.lumex.host/api/short?api_token=XXXX
|
||||||
var paramName string
|
var paramName string
|
||||||
if idType == "kp" {
|
if idType == "kp" {
|
||||||
paramName = "kinopoisk_id"
|
paramName = "kinopoisk_id"
|
||||||
@@ -173,7 +176,11 @@ func (h *PlayersHandler) GetLumexPlayer(w http.ResponseWriter, r *http.Request)
|
|||||||
paramName = "imdb_id"
|
paramName = "imdb_id"
|
||||||
}
|
}
|
||||||
|
|
||||||
playerURL := fmt.Sprintf("%s?%s=%s", h.config.LumexURL, paramName, id)
|
separator := "&"
|
||||||
|
if !strings.Contains(h.config.LumexURL, "?") {
|
||||||
|
separator = "?"
|
||||||
|
}
|
||||||
|
playerURL := fmt.Sprintf("%s% s%s=%s", h.config.LumexURL, separator, paramName, id)
|
||||||
log.Printf("Lumex URL: %s", playerURL)
|
log.Printf("Lumex URL: %s", playerURL)
|
||||||
|
|
||||||
iframe := fmt.Sprintf(`<iframe src="%s" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;"></iframe>`, playerURL)
|
iframe := fmt.Sprintf(`<iframe src="%s" allowfullscreen loading="lazy" style="border:none;width:100%%;height:100%%;"></iframe>`, playerURL)
|
||||||
|
|||||||
Reference in New Issue
Block a user