mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-06-14 19:36:50 +00:00
* Stream asset downloads to avoid OutOfMemoryException on large files ExportAssetDownloader used HttpClient.GetAsync(url, ct), which defaults to HttpCompletionOption.ResponseContentRead and buffers the entire response body into memory before returning. Downloading a large attachment therefore tried to grow a single in-memory buffer to the full file size and threw OutOfMemoryException (HttpContent.LoadIntoBufferAsync -> GrowAndWrite). Pass HttpCompletionOption.ResponseHeadersRead so the body is streamed straight to disk via CopyToAsync in bounded chunks, matching how DiscordClient already issues its requests. * Update ExportAssetDownloader.cs --------- Co-authored-by: Oleksii Holub <1935960+Tyrrrz@users.noreply.github.com>