Files
ner c41f1f098f feat(torrents): add Galaxy (TorrentGalaxy) provider with IMDb-first search and inline magnets
- new tg parser: /imdb-detail/<tt...> when an IMDb id is available (exact title, local seeder/size sort), keyword search as fallback; rows carry full magnets inline so Play works without a second fetch
- wire tg into /api/torrents and /api/magnet, TG_HOST env (default https://torrentgalaxy.info)
- Galaxy tab in the torrents modal; tabs now share equal space and hidden-scroll on overflow
- fix tab drag&drop: reorder on the sanitized order so tabs added later (like Galaxy) can be dragged
2026-10-25 18:24:08 +02:00

20 lines
594 B
TypeScript

import { NextRequest, NextResponse } from 'next/server';
import odc from '@/data/parsers/odc';
import tg from '@/data/parsers/tg';
import tlk from '@/data/parsers/tlk';
export async function GET({ nextUrl: { searchParams } }: NextRequest) {
const url = searchParams.get('url') as string;
const provider = searchParams.get('provider') as string;
try {
const magnet =
provider === 'odc' ? await odc.magnet(url) : provider === 'tg' ? await tg.magnet(url) : await tlk.magnet(url);
return NextResponse.json(magnet);
} catch (error) {
return NextResponse.error();
}
}