feat(torrents): add 0day.community tracker as a torrent provider
Private xbtit tracker (tracker.0day.community): session login via takelogin.php with cookie jar persisted to Redis, cp1251-decoded word-AND search scoped to movie/TV categories, magnet built from the fetched .torrent (download.php requires the name param) + public trackers. Generalizes /api/magnet to dispatch by provider.
This commit is contained in:
1 parent
87513bb6a8
commit
1fd8f0f7e5
11 files changed
+291
-11
No files matched your search
@@ -1,12 +1,14 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import odc from '@/data/parsers/odc';
|
||||
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 {
|
||||
return NextResponse.json(await tlk.magnet(url));
|
||||
return NextResponse.json(provider === 'odc' ? await odc.magnet(url) : await tlk.magnet(url));
|
||||
} catch (error) {
|
||||
return NextResponse.error();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user