lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.72k stars 260 forks source link

TwitchDownloaderCLI.exe crashes when saving to APFS volume on Windows #866

Open superbonaci opened 1 year ago

superbonaci commented 1 year ago

Checklist

Edition

Command Line Interface

Describe your issue here

  1. Format any USB storage device as APFS (Apple filesystem), from MacOS or other way.
  2. Connect the USB memory to Windows, and mount it as a drive with APFS for Windows by Paragon Software.
  3. Copy TwitchDownloader.exe to drive and make TMP.
  4. Open the command prompt
  5. cd to drive and run TwitchDownloader.exe
  6. Check that always fails:
    .\TwitchDownloaderCLI.exe videodownload -u 'https://www.twitch.tv/videos/1268600556' -q best --temp-path .\TMP\ -o output.mp4
    TwitchDownloaderCLI 1.53.4 Copyright (c) lay295 and contributors
    [STATUS] - Fetching Video Info [1/5]Unhandled exception. System.AggregateException: One or more errors occurred. (An invalid argument was supplied. (gql.twitch.tv:443))
    ---> System.Net.Http.HttpRequestException: An invalid argument was supplied. (gql.twitch.tv:443)
    ---> System.Net.Sockets.SocketException (10022): An invalid argument was supplied.
    at System.Net.Sockets.Socket..ctor(AddressFamily , SocketType , ProtocolType )
    at System.Net.Sockets.Socket..ctor(SocketType , ProtocolType )
    at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String , Int32 , HttpRequestMessage , Boolean , CancellationToken )
    --- End of inner exception stack trace ---
    at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String , Int32 , HttpRequestMessage , Boolean , CancellationToken )
    at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage , Boolean , CancellationToken )
    at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
    at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage )
    at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken )
    at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage , Boolean , CancellationToken )
    at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage , Boolean , Boolean , CancellationToken )
    at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage , Boolean , CancellationToken )
    at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage , HttpCompletionOption , CancellationTokenSource , Boolean , CancellationTokenSource , CancellationToken )
    at TwitchDownloaderCore.TwitchHelper.GetVideoInfo(Int32 videoId)
    at TwitchDownloaderCore.VideoDownloader.DownloadAsync(CancellationToken cancellationToken)
    --- End of inner exception stack trace ---
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean )
    at System.Threading.Tasks.Task.Wait(Int32 , CancellationToken )
    at System.Threading.Tasks.Task.Wait()
    at TwitchDownloaderCLI.Modes.DownloadVideo.Download(VideoDownloadArgs inputOptions)
    at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
    at TwitchDownloaderCLI.Program.Main(String[] args)

    Probably some bug in .NET Framework that doesn't work with third party kernel drivers.

Add any related files or extra information here

Couple screenshots

SSD1

SSD2

superbonaci commented 1 year ago

I think this is some issue related to Windows/NET but not sure, if anybody knows please help.

ScrubN commented 1 year ago

The stacktrace indicates that the exception was thrown before any disk IO occurs. I think it is most likely that Twitch servers in your area were doing maintenance or similar.

ScrubN commented 1 year ago

Please delete COPYRIGHT.txt and THIRD-PARTY-LICENSES.txt, then rerun anything in TwitchDownloader. If the license files reappear then dotnet is indeed able to read and write from your file system.

superbonaci commented 1 year ago

Turns out I can run .\TwitchDownloaderCLI and .\TwitchDownloaderCLI help, and both work, but none of them generate the copyright and license files. It only happens when I run the videodownload command as stated before, them immediately is the error.

Looks like some NET issue, since DownloadHelper browser extension can download directly the .m2ts to the apfs drive. No idea if such extension is coded in NET but I would be surprised if did.

ScrubN commented 1 year ago

Turns out I can run .\TwitchDownloaderCLI and .\TwitchDownloaderCLI help, and both work, but none of them generate the copyright and license files

Both of those count as "failed to parse" in the CLI parsing library, so they quit before the license files are written to the disk.