{"record":{"id":"2cf403a6c1d6e7a5","repo":"nilaoda/N_m3u8DL-RE","slug":"download-speed-too-slow","errorCode":null,"errorMessage":"Download speed too slow!","messagePattern":"Download speed too slow!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/N_m3u8DL-RE/Util/DownloadUtil.cs","lineNumber":140,"sourceCode":"while ((size = await responseStream.ReadAsync(buffer, cancellationTokenSource.Token)) > 0)\n{\n    speedContainer.Add(size);\n    await stream.WriteAsync(buffer.AsMemory(0, size));\n    // 限速策略\n    while (speedContainer.Downloaded > speedContainer.SpeedLimit)\n    {\n        await Task.Delay(1);\n    }\n}\n\nreturn new DownloadResult()\n{\n    ActualContentLength = stream.Length,\n    RespContentLength = contentLength,\n    ActualFilePath = path,\n    ImageHeader= imageHeader,\n    GzipHeader = gZipHeader\n};\n}\ncatch (OperationCanceledException oce) when (oce.CancellationToken == cancellationTokenSource.Token)\n{\n    speedContainer.ResetLowSpeedCount();\n    throw new Exception(\"Download speed too slow!\");\n}","sourceCodeStart":122,"sourceCodeEnd":143,"githubUrl":"https://github.com/nilaoda/N_m3u8DL-RE/blob/e113dee70c924ee08dae5460624909b04d84cb76/src/N_m3u8DL-RE/Util/DownloadUtil.cs#L122-L143","documentation":"DownloadUtil.DownloadToFileAsync monitors transfer speed via a SpeedContainer that counts a 'low speed' condition; when detected it triggers the cancellation token, and the catch block converts the resulting OperationCanceledException into this error. It means the HTTP download of a segment/file fell below the acceptable speed threshold (e.g. ~10KB/s for 15s) and was deliberately aborted, not a network protocol failure.","triggerScenarios":"Remote host throttles the connection (rate-limited CDN), heavy network congestion, or too many parallel downloads starving each connection so throughput stays under the low-speed threshold long enough to trip the watchdog.","commonSituations":"Downloading many segments concurrently from a throttling server; VPN/proxy bottlenecks; Wi-Fi dropouts during a long segment download.","solutions":["Retry the download; the failure is often transient server/network slowness","Use a different server/CDN mirror if the URL supports it","Lower --max-concurrent-download or -x connections so each connection gets bandwidth","Check local network, proxy, or VPN throughput","Increase the slow-speed tolerance if the tool exposes related options"],"exampleFix":"Re-run the same command; if it recurs, reduce concurrency (e.g. --max-concurrent-download 4) or switch network/proxy so per-connection speed stays above the low-speed threshold.","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep concurrency within available bandwidth","Avoid unreliable proxies/VPNs for large downloads","Ensure stable wired connection for long batch downloads"],"tags":[],"backgroundTag":null,"analyzedSha":"e113dee70c924ee08dae5460624909b04d84cb76","analyzedAt":"2026-09-13T02:43:21.078Z","contentChangedAt":"2026-09-13T02:43:21.078Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}