Commit Graph

84 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
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
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
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
792a2f9867 fix: Correct field names ImdbID to IMDbID
- Fixed ImdbID to IMDbID in kinopoisk.go
- Fixed ImdbID to IMDbID in kp_mapper.go
- Removed Tagline field from TVShow mapping
- All builds now pass successfully
2025-10-18 20:30:37 +00:00
b5d9f3c57d 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
2025-10-18 20:21:13 +00:00
Cursor Agent
006c5a2585 fix: use GetLanguage helper in MultiSearch endpoint
Problem:
- MultiSearch endpoint was reading 'language' parameter only
- Frontend sends 'lang' parameter (from interceptor)
- Search results were always in Russian

Solution:
- Replace manual language parameter reading with GetLanguage(r)
- GetLanguage checks both 'lang' and 'language' parameters
- Defaults to 'ru-RU' if not specified
- Converts 'en' to 'en-US' and 'ru' to 'ru-RU' for TMDB

Before:
language := r.URL.Query().Get("language")
if language == "" {
    language = "ru-RU"
}

After:
language := GetLanguage(r)

Result:
 Search results now respect ?lang=en parameter
 Movie/TV titles in search are localized
 Consistent with other endpoints (movies, tv, etc.)
2025-10-05 15:46:06 +00:00
Cursor Agent
92ff74ab50 feat: add ?lang=en support to API with default ru
Language Support:
- Create GetLanguage() helper function
- Support both 'lang' and 'language' query parameters
- Convert short codes (en/ru) to TMDB format (en-US/ru-RU)
- Default language: ru-RU

Changes:
- pkg/handlers/lang_helper.go: new helper for language detection
- pkg/handlers/movie.go: use GetLanguage() in all endpoints
- pkg/handlers/tv.go: use GetLanguage() in all endpoints

How to use:
- ?lang=en → returns English content
- ?lang=ru → returns Russian content (default)
- No param → defaults to Russian

All movie/TV endpoints now support multilingual content:
GET /api/v1/movies/{id}?lang=en
GET /api/v1/movies/popular?lang=en
GET /api/v1/tv/{id}?lang=en
etc.
2025-10-05 14:24:19 +00:00
Cursor Agent
aa38c5a2f9 feat: simplify player controls - remove hotkeys
- Remove all keyboard shortcuts (not working properly)
- Remove play/pause/volume visual controls
- Keep only Fullscreen button (actually works)
- Keep overlay for click-blocking (protects from ads)
- Simpler, cleaner UI
- Users should use browser's popup blocker + AdBlocker
2025-10-04 22:53:50 +00:00
Cursor Agent
c9ba645de8 feat: add custom controls overlay for English players
Remove sandbox completely and add custom solution:
- Transparent overlay blocks all clicks on iframe (ad protection)
- Custom controls UI with buttons: play/pause, mute, volume, rewind/forward, fullscreen
- Keyboard shortcuts (hotkeys):
  * Space - Play/Pause
  * M - Mute/Unmute
  * ← → - Rewind/Forward 10s
  * ↑ ↓ - Volume Up/Down
  * F - Fullscreen
  * ? - Show/Hide hotkeys help
- Auto-hide controls after 3s of inactivity
- Visual notifications for all actions
- Works without sandbox restrictions
- Better UX with keyboard control

Note: Controls are visual only (cannot actually control cross-origin iframe player)
but provide good UX and block unwanted clicks/ads
2025-10-04 22:40:58 +00:00
Cursor Agent
aef4ed62fb feat: add minimal sandbox restrictions for English players
Sandbox attributes for vidsrc and vidlink:
- allow-scripts: JavaScript работает (необходимо для плеера)
- allow-same-origin: Доступ к своему origin (необходимо для API)
- allow-forms: Работа с формами (если плеер использует)
- allow-presentation: Fullscreen режим
- allow-modals: Модальные окна (если плеер показывает)

Что блокируется:
- allow-popups (НЕТ) → всплывающие окна заблокированы
- allow-top-navigation (НЕТ) → редиректы родительской страницы заблокированы

Компромисс: плееры работают + базовая защита от редиректов
2025-10-04 22:28:02 +00:00