feat(player): external subtitles via OpenSubtitles

Add an OpenSubtitles client, /api/subtitles routes and useSubtitles to
fetch subtitles by show/episode/filename, wire them as player tracks
alongside embedded ones, and strip hls.js's auto-added tracks. New
OPENSUBTITLES_* / SUBTITLE_LANGUAGES env vars (documented in env.example).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
nerandClaude Opus 4.8 committed 2026-08-08 13:17:12 +03:00
1 parent c695697c4f
commit ecc57ff135
24 files changed
+372 -67

No files matched your search

-5
View File
@@ -3,11 +3,6 @@ import { NextRequest, NextResponse } from 'next/server';
import tlk from '@/data/parsers/tlk';
import { STREAM_URL } from '@/env';
// Public proxy the TV calls to re-pull a Toloka thread's CURRENT magnet.
// Given a Toloka topic/thread id (the `id` in download.php?id=<id>), it
// re-downloads the thread's .torrent server-side (auth handled by the Toloka
// client) and returns a fresh magnet + the derived stream m3u. The TV holds
// only the numeric id — never Toloka's authenticated URL.
export async function GET({ nextUrl: { searchParams } }: NextRequest) {
const tid = searchParams.get('tid');