C2c Download Manager //top\\ (2024)

class TransferJob(BaseModel): source_url: str target_url: str chunk_size: int = 8192 * 1024 # 8MB overwrite: bool = False headers: Optional[dict] = None

async def c2c_transfer(job_id: str, job: TransferJob): """Transfer directly from source URL to target URL""" try: async with aiohttp.ClientSession() as session: # Stream from source async with session.get(job.source_url, headers=job.headers) as resp: total = int(resp.headers.get('content-length', 0)) written = 0 c2c download manager

// AWS Lambda / Google Cloud Function exports.c2cTransfer = async (req, res) => const source, target = req.body; const sourceStream = await fetch(source); await fetch(target, method: 'PUT', body: sourceStream.body ); target = req.body