The response ended prematurely
See original GitHub issueThis video is not downloadable with your client: https://www.youtube.com/watch?v=rFCE6XpC2cw
Enter YouTube video ID or URL: rFCE6XpC2cw
Downloading stream: 720p / mp4... Completed √
Unhandled exception. System.IO.IOException: The response ended prematurely, with at least 88354044 additional bytes expected.
at System.Net.Http.HttpConnection.ContentLengthReadStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
at YoutubeExplode.ReverseEngineering.YoutubeMediaStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in YoutubeExplode\YoutubeExplode\ReverseEngineering\YoutubeMediaStream.cs:line 88
at YoutubeExplode.Internal.Extensions.StreamExtensions.CopyBufferedToAsync(Stream source, Stream destination, Byte[] buffer, CancellationToken cancellationToken) in YoutubeExplode\YoutubeExplode\Internal\Extensions\StreamExtensions.cs:line 13
at YoutubeExplode.Internal.Extensions.StreamExtensions.CopyToAsync(Stream source, Stream destination, IProgress`1 progress, CancellationToken cancellationToken) in YoutubeExplode\YoutubeExplode\Internal\Extensions\StreamExtensions.cs:line 28
at YoutubeExplode.Videos.Streams.StreamClient.CopyToAsync(IStreamInfo streamInfo, Stream destination, IProgress`1 progress, CancellationToken cancellationToken) in YoutubeExplode\YoutubeExplode\Videos\Streams\StreamClient.cs:line 310
at YoutubeExplode.Videos.Streams.StreamClient.DownloadAsync(IStreamInfo streamInfo, String filePath, IProgress`1 progress, CancellationToken cancellationToken) in YoutubeExplode\YoutubeExplode\Videos\Streams\StreamClient.cs:line 320
at YoutubeExplode.DemoConsole.Program.Main() in YoutubeExplode\YoutubeExplode.DemoConsole\Program.cs:line 40
at YoutubeExplode.DemoConsole.Program.<Main>()
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
c# - Getting HttpRequestExceptions: The response ended ...
Sadly, the innermost exception IS "The response ended prematurely." Looks like the SERVER is closing the socket too soon. Though it might be ......
Read more >HttpClient The response ended prematurely · Issue #72177
Description I'm running a legacy HTTP server and I randomly get the The response ended prematurely error while receiving the payload body.
Read more >QueryAsync HttpRequestExceptions - Response ended ...
Running a DotNet Core 3.1 app with the Couchbase .NET client 2.7.26. I recently updated a test server from Couchbase Enterprise Edition ...
Read more >System.IO.IOException - The response ended prematurely
IOException Message: The response ended prematurely. StackTrace: at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request ...
Read more >"The response ended prematurely" after one hour of...
Solved: I'm trying to download a large (80Gb) file from the Dropbox servers. After *exactly* one hour, I get an exception indicating that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No idea. The problem is that YouTube returns a response, but ends it prematurely. We can’t tell YouTube to make a proper response. In fact, YouTube’s frontend is known to be filled with lots of bugs which are mostly worked around with try/catches and retries.
Thank you, @VahidN , I was able to run
YoutubeExplode.DemoConsole
on both, Windows and Linux.