schneidermanuel / TwitchLeecher-Dx

Twitch Leecher DX - The Broadcast Downloader
MIT License
118 stars 6 forks source link

Been getting a variety of odd errors when downloading #39

Closed notMae3 closed 4 weeks ago

notMae3 commented 1 month ago

Description

Been getting a lot of errors right after the "Starting temporary download folder cleanup!" phase is completed. The below log file is one of said errors. Got similar but not exactly the same error across 5 different downloads. Strange thing is one week all downloads work, the next none work. This might be an issue on my part, but if so I'd like to understand how to fix it.

Information

- Twitch vod url and channel

https://www.twitch.tv/videos/2215113419 https://www.twitch.tv/fanfan

- Operating system

Windows 11 home - 64 bit - version: 23H2 - OS build: 22631.3880

- Log

Download task has been started!

TWITCH LEECHER INFO

Version: 3.6.1

VOD INFO

VOD ID: 2215113419 Selected Quality: 1080p60 (1920x1080) Download Url: https://www.twitch.tv/videos/2215113419 Crop Start: No Crop End: No

OUTPUT INFO

Disable Conversion: No Output File: A:\Downloaded vids\Vods\20240804_fanfan_2215113419.mp4 FFMPEG Path: D:\TwitchLeecher-Dx\ffmpeg.exe Temporary Download Folder: C:\Users\thema\AppData\Local\Temp\fd8fc6bf56ba439ea6f398d932394ed6

Retrieving VOD access information... done!

ACCESS INFO

Token: %7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22device_id%22%3Anull%2C%22expires%22%3A1722863491%2C%22https_required%22%3Atrue%2C%22privileged%22%3Afalse%2C%22user_id%22%3Anull%2C%22version%22%3A2%2C%22vod_id%22%3A2215113419%7D Signature: da3ce539874ca68d4373add9ab31a1923e9c8ef5 Sub-Only: No Privileged: No

Creating temporary download directory 'C:\Users\thema\AppData\Local\Temp\fd8fc6bf56ba439ea6f398d932394ed6'... done!

Retrieving playlist information for all VOD qualities... done!

PLAYLIST INFO

Playlist for quality '1080p60' is 'https://d2nvs31859zcd8.cloudfront.net/73500b550dc31ed639ff_fanfan_44627865563_1722725681/chunked/index-dvr.m3u8' Playlist for quality '720p60' is 'https://d2nvs31859zcd8.cloudfront.net/73500b550dc31ed639ff_fanfan_44627865563_1722725681/720p60/index-dvr.m3u8' Playlist for quality '480p' is 'https://d2nvs31859zcd8.cloudfront.net/73500b550dc31ed639ff_fanfan_44627865563_1722725681/480p30/index-dvr.m3u8' Playlist for quality 'Audio Only' is 'https://d2nvs31859zcd8.cloudfront.net/73500b550dc31ed639ff_fanfan_44627865563_1722725681/audio_only/index-dvr.m3u8' Playlist for quality '360p' is 'https://d2nvs31859zcd8.cloudfront.net/73500b550dc31ed639ff_fanfan_44627865563_1722725681/360p30/index-dvr.m3u8' Playlist for quality '160p' is 'https://d2nvs31859zcd8.cloudfront.net/73500b550dc31ed639ff_fanfan_44627865563_1722725681/160p30/index-dvr.m3u8'

Playlist url for selected quality '1080p60 (1920x1080)' is 'https://d2nvs31859zcd8.cloudfront.net/73500b550dc31ed639ff_fanfan_44627865563_1722725681/chunked/index-dvr.m3u8'

Retrieving playlist... done! Parsing playlist... done! Number of video chunks: 1486

Starting parallel video chunk download Number of video chunks to download: 1486 Maximum connection count: 10

Parallel video chunk download is running...

Starting temporary download folder cleanup! Deleting directory 'C:\Users\thema\AppData\Local\Temp\fd8fc6bf56ba439ea6f398d932394ed6'... done!

Download task ended with an error!

System.AggregateException: One or more errors occurred. (One or more errors occurred. (The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.)) ---> System.AggregateException: One or more errors occurred. (The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.) ---> System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. ---> System.TimeoutException: The operation was canceled. ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'. at System.Net.Sockets.NetworkStream.gThrowObjectDisposedException|63_0() at System.Net.Sockets.NetworkStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory1 buffer) --- End of inner exception stack trace --- at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory`1 buffer) at System.Net.Http.HttpConnection.FillAsync(Boolean async) at System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, Boolean async, UInt64 length, Int32 bufferSize, CancellationToken cancellationToken) at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetByteArrayAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts) at System.Net.Http.HttpClient.GetByteArrayAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) at TwitchLeecher.Services.Services.DownloadService.<>c__DisplayClass27_0.b0(TwitchPlaylistPart part, ParallelLoopState loopState) in C:\Users\rdp\Desktop\Twitchleecher-Dx\TwitchLeecher\TwitchLeecher.Services\Services\DownloadService.cs:line 528 at System.Threading.Tasks.Parallel.<>cDisplayClass19_01.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass19_01.b1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction1 action, ParallelOptions options, Boolean stopOnFirstFailure) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IList1 list, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, ParallelOptions parallelOptions, Action2 body) at TwitchLeecher.Services.Services.DownloadService.DownloadParts(Action1 log, Action1 setStatus, Action1 setProgress, TwitchPlaylist vodPlaylist, CancellationToken cancellationToken) in C:\Users\rdp\Desktop\Twitchleecher-Dx\TwitchLeecher\TwitchLeecher.Services\Services\DownloadService.cs:line 514 at TwitchLeecher.Services.Services.DownloadService.<>c__DisplayClass19_0.b__2() in C:\Users\rdp\Desktop\Twitchleecher-Dx\TwitchLeecher\TwitchLeecher.Services\Services\DownloadService.cs:line 227 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of inner exception stack trace ---

notMae3 commented 1 month ago

Reinstalling twitch leecher dx does nothing.

notMae3 commented 1 month ago

Decided to test how many of the chunks actually get downloaded with a python script. 474 out of 1486 chunks get downloaded, then the temp dir gets cleared. Potentially irrelevant but seems strange to me.

(amount of files in temp dir, 1/20s between each check)

... 473 474 474 474 438 383 331 279 227 178 129 81 38 dir exists: False

schneidermanuel commented 1 month ago

Hey, thanks for reporting. The error seems to be "The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing". You are not the first user experiencing this problem, others had this before. However, I was never able to reproduce it on my system. I currently have one idea in mind: I set the Maximum connection count to be 10, the old Twitch Leecher had this Value set to 3. I found that, on my system and my network, a value of 10 got me the fastest downloads.

I will add this value to the settings page, with 10 being the default Value. When the update is out, I would appreciate it, if you try setting this down to 3 again and tell me if you get any luck with this. I dont know if this has an influence at all, but its the only thing I can think of at the moment. Its hard to fix a issue without being able to reproduce it.

schneidermanuel commented 1 month ago

Bug was reproduced today and a fix should be available this weekend

schneidermanuel commented 4 weeks ago

With the newest version, you can set the count of chunks downloaded in parallel in the settings. Try lowering this value if you encounter this error. A count of 3-5 should work fine