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(provider === 'odc' ? await odc.magnet(url) : await tlk.magnet(url)); } catch (error) { return NextResponse.error(); } }