153 Commits

Author SHA1 Message Date
faf0421b44 Add support/list endpoint with fallback data 2025-11-25 18:54:23 +02:00
b323e6940d add supporters list 2025-11-25 17:35:18 +02:00
48c09e4fb6 fixes 2025-11-23 16:06:00 +02:00
3731c76f27 small fixes 2025-11-22 20:19:25 +02:00
2928c3417b v3.0.1 2025-11-22 19:52:58 +02:00
5a4b6a9396 upd favorites 2025-11-21 20:46:54 +02:00
7b38988210 upd favorites 2025-11-21 20:16:56 +02:00
1ca20bb7a7 fix kinopoisk api 2025-11-21 17:34:18 +02:00
084d9fb09b fix kinopoisk api 2025-11-21 17:13:22 +02:00
26b4ea7f56 fix kinopoisk api 2025-11-21 17:09:51 +02:00
be39714a87 Ed docs 2025-11-21 16:54:47 +02:00
a3a7aa2474 Add 'api/v1/tv/top-rated' route' 2025-11-21 16:51:39 +02:00
65e7ff90bd Fix '/api/v1/movies/popular' route 2025-11-21 16:29:08 +02:00
d9e48495f7 fixes 2025-11-19 15:22:55 +00:00
20d0f5e43e Add log 2025-11-19 15:02:59 +00:00
5ec97187e4 simplify proxy 2025-11-09 20:22:41 +02:00
c1e9be71b2 simplify proxy 2025-11-09 20:14:44 +02:00
31ddaafe0b Merge branch 'feature/docker' into 'main'
Dockerfile

See merge request foxixus/neomovies-api!5
2025-11-09 11:51:10 +00:00
iwnuplynottyan
d3616e33ad Dockerfile 2025-11-09 13:31:06 +02:00
Erno
c988c762a9 chore(netlify): add serverless config and function entry for API 2025-10-22 08:48:13 +00:00
Erno
f42d548105 fix(players/alloha): parse map-based seasons/episodes structure and include translations 2025-10-21 16:01:25 +00:00
Erno
04fe3f3925 feat(players/alloha): add meta endpoint for seasons/episodes; perf: http clients/transport; docs: update 2025-10-21 15:35:20 +00:00
Erno
53a405a743 feat(search): include originalType (FILM/TV_SERIES) for KP results; ensure KP poster/backdrop proxied 2025-10-20 19:02:05 +00:00
Erno
71ea922528 feat(unified-kp): return KP poster/backdrop via our /api/v1/images proxy too 2025-10-20 18:50:30 +00:00
Erno
47bcc6589d fix(images): normalize malformed absolute URLs (https:/ → https://, // → https://) 2025-10-19 19:39:11 +00:00
Erno
95aae4c46d feat(unified): return poster/backdrop URLs via our /api/v1/images proxy for TMDB and KP 2025-10-19 19:31:37 +00:00
Erno
2237e27308 fix(images): decode path early and treat decoded placeholder; handle absolute URLs reliably 2025-10-19 17:12:52 +00:00
Erno
f8d54a2901 feat(players): use p.lumex.cloud iframe with kp_id; fix(images): robust proxy for absolute URLs (decode, timeout, headers) 2025-10-19 17:08:58 +00:00
Erno
1f51746740 feat(players): build Lumex URL as portal.lumex.host/api/short?api_token=...&kinopoisk_id=... (or imdb_id) 2025-10-19 16:32:07 +00:00
Erno
e68ce7f114 feat(images): proxy external http(s) poster URLs; feat(players): accept 'kinopoisk_id' alias for Lumex 2025-10-19 15:55:57 +00:00
Erno
608eeb7dcf fix: resolve unified handler merge and keep tmdb id enrichment only in externalIds 2025-10-19 13:51:47 +00:00
33572b0cff fix(api): add TMDB ID enrichment for KP content via IMDB ID lookup
- Add TMDBID field to ExternalIDs model
- Enhance GetExternalIDs in MovieService and TVService to fetch TMDB ID via FindTMDBIdByIMDB
- Add EnrichKPWithTMDBID function to enrich unified content with TMDB IDs
- Update unified handlers to automatically enrich KP content with TMDB IDs
- Enrich search results with TMDB IDs by fetching full film data for each result

This ensures that when using source=kp, the response includes TMDB IDs in externalIds
when available through IMDB ID mapping, while preserving all original KP data.
2025-10-19 12:48:11 +00:00
Erno
b86c9fc340 feat(api): enrich KP movie by resolving TMDB via IMDb /find endpoint 2025-10-19 10:42:03 +00:00
Erno
10d57af843 docs(unified): update OpenAPI info, replace /search/multi with /search, and describe source param 2025-10-19 10:17:40 +00:00
Erno
85c1a1b365 fix(kp): url-escape keyword and imdbId in Kinopoisk requests to avoid 502 2025-10-19 10:03:53 +00:00
Erno
b504e96287 docs(api): document unified routes and response schema 2025-10-19 09:19:44 +00:00
Erno
0d32fa6afc feat(unified): add seasons to unified content and map TMDB seasons 2025-10-19 09:10:01 +00:00
Erno
43af05cf91 feat(api): add unified models, mappers, and prefixed routes (movie/tv/search) 2025-10-19 08:46:25 +00:00
Erno
855cc0920c feat(api): support prefixed IDs in routes and add unified mappers scaffolding
- Handlers parse IDs like kp_123 / tmdb_456 and set id_type accordingly
- Add KP->Unified and TMDB->Unified movie mappers (basic fields)
- Keep backward compatibility for numeric IDs
2025-10-19 08:30:16 +00:00
Erno
0bdecfdf6f fix(search): force KP for ru language in multi search
- MultiSearch returns KP results when lang starts with ru
- No fallback to TMDB for ru; KP errors bubble up
2025-10-19 07:47:59 +00:00
Erno
86042e2580 fix(api): respect explicit id_type and remove hidden TMDB fallback
- Movies/TV: if id_type=kp, fetch only from Kinopoisk (with TMDB->KP conversion)
- Movies/TV: if id_type=tmdb, fetch only from TMDB
- Default (no id_type): keep language-based behavior
- README: redact example tokens/keys with placeholders

Prevents wrong provider data when opened from search links with id_type.
2025-10-19 07:40:37 +00:00
dec78baffe fix: Remove TMDB fallback and add ID conversion for strict id_type handling
ПРОБЛЕМА:
- При id_type='kp' код делал fallback на TMDB если фильм не найден
- Если передан TMDB ID с id_type='kp', возвращались данные из TMDB
- Нарушалась явная логика выбора источника

РЕШЕНИЕ:
1. Убран автоматический fallback на TMDB при id_type='kp'
2. Добавлена конвертация ID:
   - Если id_type='kp' и фильм не найден напрямую
   - Пробуем конвертировать TMDB ID → KP ID через TmdbIdToKPId
   - Запрашиваем данные по сконвертированному KP ID
3. Если конвертация не удалась → возвращаем ошибку

ЛОГИКА:
- id_type='kp' + ID=550 (TMDB):
  1. Поиск KP фильма с id=550 → не найдено
  2. Конвертация 550 (TMDB) → получаем KP ID (например 326)
  3. Поиск KP фильма с id=326 → успех
  4. Возврат данных из Kinopoisk 

- id_type='kp' + несуществующий ID:
  1. Поиск KP фильма → не найдено
  2. Конвертация → не удалась
  3. Возврат ошибки (НЕ fallback на TMDB) 

ИЗМЕНЕНИЯ:
- pkg/services/movie.go: добавлена конвертация и удален fallback
- pkg/services/tv.go: добавлена конвертация и удален fallback
- Добавлен import fmt для форматирования ошибок

РЕЗУЛЬТАТ:
 Строгое соблюдение id_type параметра
 Умная конвертация между TMDB и KP ID
 Нет неожиданного fallback на другой источник
2025-10-18 23:55:42 +00:00
e2c6201e7e feat: Add id_type parameter support for movies and TV shows 2025-10-18 23:41:53 +00:00
bb63eb741d fix: Replace ioutil.ReadAll with io.ReadAll
- Fix undefined ioutil error
- Use io.ReadAll from io package (Go 1.16+)
2025-10-18 22:27:53 +00:00
5e45d94932 fix: HDVB player implementation
- Fetch iframe_url from HDVB API instead of direct embed
- Parse JSON response to extract iframe_url
- Use io.ReadAll instead of direct URL embed
- Fixes 'Не передан ни один параметр' error
- HDVB API returns JSON with iframe_url field
2025-10-18 22:18:35 +00:00
9063d3e431 fix: Handle Kinopoisk IDs in GetExternalIDs
- Try to fetch from KP API first by KP ID
- If KP data found, return external IDs directly
- Falls back to TMDB if KP ID not found
- Fixes 500 error for Russian content external IDs
2025-10-18 22:05:51 +00:00
4a50bfd96d fix: Generate OpenAPI spec inline instead of file reference
- Use SpecContent with marshaled JSON instead of SpecURL
- Prevents 'open /openapi.json: no such file or directory' error
- Documentation now loads properly on all domains
2025-10-18 21:35:34 +00:00
31165ceeac fix: Use relative URL for OpenAPI spec to bypass Cloudflare
- Change SpecURL from absolute to relative path
- Fixes documentation loading on api.neomovies.ru
- Browser will request openapi.json from same domain
2025-10-18 21:19:57 +00:00
740f1c92fc fix: Add additional cache headers for documentation
- Add Pragma: no-cache
- Add Expires: 0
- Ensure documentation never cached on api.neomovies.ru
2025-10-18 21:16:17 +00:00
db5bafca9b fix: Update api/index.go and README with new API format
- Fix NewSearchHandler call in api/index.go to include kpService
- Update README with Kinopoisk API integration details
- Document new player API format: /players/{player}/{id_type}/{id}
- Add all new environment variables (KPAPI_KEY, HDVB_TOKEN, etc)
- Add examples for both kp and imdb ID types
2025-10-18 21:04:46 +00:00