2 Commits

Author SHA1 Message Date
factory-droid[bot]
bdeb1e1d74 feat: add RgShows and IframeVideo streaming players
🎬 New Streaming Players Added:
- RgShows player for movies and TV shows via TMDB ID
- IframeVideo player using Kinopoisk ID and IMDB ID
- Unified players manager for multiple streaming providers
- JSON API endpoints for programmatic access

📡 RgShows Player Features:
- Direct movie streaming: /api/v1/players/rgshows/{tmdb_id}
- TV show episodes: /api/v1/players/rgshows/{tmdb_id}/{season}/{episode}
- HTTP API integration with rgshows.com
- 40-second timeout for reliability
- Proper error handling and logging

🎯 IframeVideo Player Features:
- Two-step authentication process (search + token extraction)
- Support for both Kinopoisk and IMDB IDs
- HTML iframe parsing for token extraction
- Multipart form data for video URL requests
- Endpoint: /api/v1/players/iframevideo/{kinopoisk_id}/{imdb_id}

🔧 Technical Implementation:
- Clean Go architecture with pkg/players package
- StreamResult interface for consistent responses
- Proper HTTP headers mimicking browser requests
- Comprehensive error handling and logging
- RESTful API design following existing patterns

🌐 New API Endpoints:
- /api/v1/players/rgshows/{tmdb_id} - RgShows movie player
- /api/v1/players/rgshows/{tmdb_id}/{season}/{episode} - RgShows TV player
- /api/v1/players/iframevideo/{kinopoisk_id}/{imdb_id} - IframeVideo player
- /api/v1/stream/{provider}/{tmdb_id} - JSON API for stream info

 Quality Assurance:
- All code passes go vet without issues
- Proper Go formatting applied
- Modular design for easy extension
- No breaking changes to existing functionality

Ready for production deployment! 🚀
2025-09-28 15:19:54 +00:00
factory-droid[bot]
ea3159fb8e feat: implement JWT refresh token mechanism and improve auth
- Add refresh token support with 30-day expiry
- Implement automatic token rotation on refresh
- Add new endpoints: /auth/refresh, /auth/revoke-token, /auth/revoke-all-tokens
- Reduce access token lifetime to 1 hour for better security
- Store refresh tokens in user document with metadata
- Add support for token cleanup and management
- Update login flow to return both access and refresh tokens
- Maintain backward compatibility with existing auth methods
2025-09-28 11:37:56 +00:00

View File

@@ -374,8 +374,76 @@ func getOpenAPISpecWithURL(baseURL string) *OpenAPISpec {
}, },
}, },
}, },
"/api/v1/webtorrent/player": map[string]interface{}{
"get": map[string]interface{}{
"summary": "WebTorrent плеер",
"description": "Открытие WebTorrent плеера с магнет ссылкой. Плеер работает полностью на стороне клиента.",
"tags": []string{"WebTorrent"},
"parameters": []map[string]interface{}{
{
"name": "magnet",
"in": "query",
"required": false,
"schema": map[string]string{"type": "string"},
"description": "Магнет ссылка торрента",
},
{
"name": "X-Magnet-Link",
"in": "header",
"required": false,
"schema": map[string]string{"type": "string"},
"description": "Магнет ссылка через заголовок (альтернативный способ)",
},
},
"responses": map[string]interface{}{
"200": map[string]interface{}{
"description": "HTML страница с WebTorrent плеером",
"content": map[string]interface{}{
"text/html": map[string]interface{}{
"schema": map[string]string{"type": "string"},
},
},
},
"400": map[string]interface{}{
"description": "Отсутствует магнет ссылка",
},
},
},
},
"/api/v1/webtorrent/metadata": map[string]interface{}{
"get": map[string]interface{}{
"summary": "Метаданные медиа",
"description": "Получение метаданных фильма или сериала по названию для WebTorrent плеера",
"tags": []string{"WebTorrent"},
"parameters": []map[string]interface{}{
{
"name": "query",
"in": "query",
"required": true,
"schema": map[string]string{"type": "string"},
"description": "Название для поиска (извлеченное из торрента)",
},
},
"responses": map[string]interface{}{
"200": map[string]interface{}{
"description": "Метаданные найдены",
"content": map[string]interface{}{
"application/json": map[string]interface{}{
"schema": map[string]interface{}{
"$ref": "#/components/schemas/WebTorrentMetadata",
},
},
},
},
"400": map[string]interface{}{
"description": "Отсутствует параметр query",
},
"404": map[string]interface{}{
"description": "Метаданные не найдены",
},
},
},
},
"/api/v1/torrents/search/{imdbId}": map[string]interface{}{ "/api/v1/torrents/search/{imdbId}": map[string]interface{}{
"get": map[string]interface{}{ "get": map[string]interface{}{
"summary": "Поиск торрентов", "summary": "Поиск торрентов",