lay295 / TwitchDownloader

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

Twitch VOD IDs have incremented past what can be represented with an Int32 #1057

Closed Sarioah closed 1 month ago

Sarioah commented 1 month ago

Checklist

Edition

Command Line Interface

Describe your issue here

When I try to download chat from a VOD file with an ID over 2147483647, the program crashes, complaining that a value was too big for an Int32.

TwitchDownloaderCLI ChatDownload -u 2147497352 -o 2147497352.txt
TwitchDownloaderCLI 1.54.2 Copyright (c) lay295 and contributors
Unhandled exception. System.AggregateException: One or more errors occurred. (Value was either too large or too small for an Int32.)
 ---> System.OverflowException: Value was either too large or too small for an Int32.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus , TypeCode )
   at System.Number.ParseInt32(ReadOnlySpan`1 , NumberStyles , NumberFormatInfo )
   at System.Int32.Parse(String )
   at TwitchDownloaderCore.ChatDownloader.DownloadAsync(CancellationToken cancellationToken) in /home/runner/work/TwitchDownloader/TwitchDownloader/TwitchDownloaderCore/ChatDownloader.cs:line 277
   --- 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.DownloadChat.Download(ChatDownloadArgs inputOptions) in /home/runner/work/TwitchDownloader/TwitchDownloader/TwitchDownloaderCLI/Modes/DownloadChat.cs:line 22
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at TwitchDownloaderCLI.Program.Main(String[] args) in /home/runner/work/TwitchDownloader/TwitchDownloader/TwitchDownloaderCLI/Program.cs:line 34
Aborted

Add any related files or extra information here

The VOD in question is https://twitch.tv/videos/2147497352, but I'm guessing it'll keep happening for newer VODs past this point.

Linden10 commented 1 month ago

Same thing is happening to me with this vod: https://www.twitch.tv/videos/2147503463

Hope the creator see this and eventually fixes it!

wfzelle commented 1 month ago

I have the same issue. Please change the code to use Int64 instead of Int32.

nicholasyoannou commented 1 month ago

Also got this issue! Tried downloading a VOD Chat, failed and got the same error.

TwitchDownloaderCLI 1.54.2 Copyright (c) lay295 and contributors
Unhandled exception. System.AggregateException: One or more errors occurred. (Value was either too large or too small for an Int32.)
 ---> System.OverflowException: Value was either too large or too small for an Int32.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus , TypeCode )
   at System.Number.ParseInt32(ReadOnlySpan`1 , NumberStyles , NumberFormatInfo )
   at System.Int32.Parse(String )
   at TwitchDownloaderCore.ChatDownloader.DownloadAsync(CancellationToken cancellationToken) in /home/runner/work/TwitchDownloader/TwitchDownloader/TwitchDownloaderCore/ChatDownloader.cs:line 277
   --- 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.DownloadChat.Download(ChatDownloadArgs inputOptions) in /home/runner/work/TwitchDownloader/TwitchDownloader/TwitchDownloaderCLI/Modes/DownloadChat.cs:line 22
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at TwitchDownloaderCLI.Program.Main(String[] args) in /home/runner/work/TwitchDownloader/TwitchDownloader/TwitchDownloaderCLI/Program.cs:line 34
Aborted (core dumped)
nicholasyoannou commented 1 month ago

Update - It seems that the latest update fixes this in 1.54.3.

https://github.com/lay295/TwitchDownloader/releases/tag/1.54.3

wfzelle commented 1 month ago

Indeed. Thanks for the quick fix!