diff --git a/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs b/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs index ff697702..2d4eaadb 100644 --- a/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs +++ b/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs @@ -37,8 +37,8 @@ internal sealed class ChatDownloadArgs : TwitchDownloaderArgs [Option("timestamp-format", Default = TimestampFormat.Relative, HelpText = "Sets the timestamp format for .txt chat logs. Valid values are: Utc, UtcFull, Relative, and None")] public TimestampFormat TimeFormat { get; set; } - [Option("chat-connections", Default = 4, HelpText = "Number of downloading connections for chat")] - public int ChatConnections { get; set; } + [Option('t', "threads", Default = 4, HelpText = "Number of parallel download threads. Large values may result in IP rate limiting.")] + public int DownloadThreads { get; set; } [Option("silent", Default = false, HelpText = "Suppresses progress console output")] public bool Silent { get; set; } diff --git a/TwitchDownloaderCLI/Modes/Arguments/VideoDownloadArgs.cs b/TwitchDownloaderCLI/Modes/Arguments/VideoDownloadArgs.cs index 8675d7e8..d0b93b6c 100644 --- a/TwitchDownloaderCLI/Modes/Arguments/VideoDownloadArgs.cs +++ b/TwitchDownloaderCLI/Modes/Arguments/VideoDownloadArgs.cs @@ -21,7 +21,7 @@ internal sealed class VideoDownloadArgs : TwitchDownloaderArgs [Option('e', "ending", HelpText = "Time to trim ending. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")] public TimeDuration TrimEndingTime { get; set; } - [Option('t', "threads", Default = 4, HelpText = "Number of download threads.")] + [Option('t', "threads", Default = 4, HelpText = "Number of parallel download threads. Large values may result in IP rate limiting.")] public int DownloadThreads { get; set; } [Option("bandwidth", Default = -1, HelpText = "The maximum bandwidth a thread will be allowed to use in kibibytes per second (KiB/s), or -1 for no maximum.")] diff --git a/TwitchDownloaderCLI/Modes/DownloadChat.cs b/TwitchDownloaderCLI/Modes/DownloadChat.cs index e39c4d21..f0eb9fb8 100644 --- a/TwitchDownloaderCLI/Modes/DownloadChat.cs +++ b/TwitchDownloaderCLI/Modes/DownloadChat.cs @@ -59,7 +59,7 @@ private static ChatDownloadOptions GetDownloadOptions(ChatDownloadArgs inputOpti : inputOptions.OutputFile, Compression = inputOptions.Compression, TimeFormat = inputOptions.TimeFormat, - ConnectionCount = inputOptions.ChatConnections, + DownloadThreads = inputOptions.DownloadThreads, Silent = inputOptions.Silent, BttvEmotes = (bool)inputOptions.BttvEmotes!, FfzEmotes = (bool)inputOptions.FfzEmotes!, diff --git a/TwitchDownloaderCLI/README.md b/TwitchDownloaderCLI/README.md index 25e5100c..f33335e1 100644 --- a/TwitchDownloaderCLI/README.md +++ b/TwitchDownloaderCLI/README.md @@ -52,7 +52,7 @@ Time to trim beginning. See [Time durations](#time-durations) for a more detaile Time to trim ending. See [Time durations](#time-durations) for a more detailed explanation. **-t / --threads** -(Default: `4`) Number of download threads. +(Default: `4`) Number of parallel download threads. Large values may result in IP rate limiting. **--bandwidth** (Default: `-1`) The maximum bandwidth a thread will be allowed to use in kibibytes per second (KiB/s), or `-1` for no maximum. @@ -123,8 +123,8 @@ Time to trim ending. See [Time durations](#time-durations) for a more detailed e **--timestamp-format** (Default: `Relative`) Sets the timestamp format for .txt chat logs. Valid values are: `Utc`, `UtcFull`, `Relative`, and `None`. -**--chat-connections** -(Default: `4`) The number of parallel downloads for chat. +**-t / --threads** +(Default: `4`) Number of parallel download threads. Large values may result in IP rate limiting. **--temp-path** Path to temporary folder for cache. diff --git a/TwitchDownloaderCLI/Tools/PreParseArgs.cs b/TwitchDownloaderCLI/Tools/PreParseArgs.cs index 793a7c65..017380c0 100644 --- a/TwitchDownloaderCLI/Tools/PreParseArgs.cs +++ b/TwitchDownloaderCLI/Tools/PreParseArgs.cs @@ -9,7 +9,7 @@ internal static class PreParseArgs { internal static string[] Parse(string[] args, string processFileName) { - if (args.Any(x => x is "-m" or "--mode" or "--embed-emotes" or "--silent" or "--verbose-ffmpeg")) + if (args.Any(x => x is "-m" or "--mode" or "--embed-emotes" or "--silent" or "--verbose-ffmpeg" or "--chat-connections")) { // A legacy syntax was used, convert to new syntax return Process(ConvertFromOldSyntax(args, processFileName)); @@ -56,17 +56,23 @@ private static string[] ConvertFromOldSyntax(string[] args, string processFileNa Console.WriteLine("[INFO] The program has switched from --verbose-ffmpeg to log levels, consider using log levels instead. '--log-level Status,Info,Warning,Error,Ffmpeg' will be applied to the current session. Run \'{0} help\' for more information.", processFileName); ConvertVerboseFfmpegSyntax(processedArgs, i); break; + case "--chat-connections": + Console.WriteLine("[INFO] The program has switched from --chat-connections to -t / --threads, consider using those instead. Run \'{0} help\' for more information.", processFileName); + ConvertChatConnectionsSyntax(processedArgs, i); + break; } } return processedArgs.ToArray(); } + // Added at 2022-11-20T21:58:54Z (1668981534) private static void ConvertEmbedEmoteSyntax(IList args, int index) { args[index] = "-E"; } + // Added at 2022-11-13T06:02:21Z (1668319341000) private static void ConvertModeSyntax(IList args, int index) { // --mode @@ -78,12 +84,14 @@ private static void ConvertModeSyntax(IList args, int index) args.Insert(0, runMode); } + // Added at 2024-03-31T20:09:53Z (1711915793000) private static void ConvertSilentSyntax(IList args, int index) { args[index] = "--log-level"; args.Insert(index + 1, nameof(LogLevel.None)); } + // Added at 2024-04-06T04:18:40Z (1712377120000) private static void ConvertVerboseFfmpegSyntax(IList args, int index) { // If the user is still using --verbose-ffmpeg they probably aren't using log levels yet, so its safe to assume that there won't be a double-parse error @@ -94,5 +102,11 @@ private static void ConvertVerboseFfmpegSyntax(IList args, int index) args.Insert(index + 1, string.Join(',', logLevels)); } + + // Added at 2024-05-03T00:06:05Z (1714694765400) + private static void ConvertChatConnectionsSyntax(IList args, int index) + { + args[index] = "--threads"; + } } } diff --git a/TwitchDownloaderCore/ChatDownloader.cs b/TwitchDownloaderCore/ChatDownloader.cs index 27742920..33b9f321 100644 --- a/TwitchDownloaderCore/ChatDownloader.cs +++ b/TwitchDownloaderCore/ChatDownloader.cs @@ -270,7 +270,7 @@ public async Task DownloadAsync(CancellationToken cancellationToken) double videoTotalLength; int viewCount; string game; - int connectionCount = downloadOptions.ConnectionCount; + int connectionCount = downloadOptions.DownloadThreads; if (downloadType == DownloadType.Video) { diff --git a/TwitchDownloaderCore/ChatUpdater.cs b/TwitchDownloaderCore/ChatUpdater.cs index 9b99987a..e8096f0b 100644 --- a/TwitchDownloaderCore/ChatUpdater.cs +++ b/TwitchDownloaderCore/ChatUpdater.cs @@ -444,7 +444,7 @@ private ChatDownloadOptions GetTrimDownloadOptions(string videoId, string tempFi TrimBeginningTime = sectionStart, TrimEnding = true, TrimEndingTime = sectionEnd, - ConnectionCount = 4, + DownloadThreads = 4, EmbedData = false, BttvEmotes = false, FfzEmotes = false, diff --git a/TwitchDownloaderCore/Options/ChatDownloadOptions.cs b/TwitchDownloaderCore/Options/ChatDownloadOptions.cs index 9ce91be9..bf6ee5ca 100644 --- a/TwitchDownloaderCore/Options/ChatDownloadOptions.cs +++ b/TwitchDownloaderCore/Options/ChatDownloadOptions.cs @@ -16,7 +16,7 @@ public class ChatDownloadOptions public bool BttvEmotes { get; set; } public bool FfzEmotes { get; set; } public bool StvEmotes { get; set; } - public int ConnectionCount { get; set; } = 1; + public int DownloadThreads { get; set; } = 1; public bool Silent { get; set; } = false; public TimestampFormat TimeFormat { get; set; } public string FileExtension diff --git a/TwitchDownloaderWPF/PageChatDownload.xaml b/TwitchDownloaderWPF/PageChatDownload.xaml index 01485d8b..4e3cc10c 100644 --- a/TwitchDownloaderWPF/PageChatDownload.xaml +++ b/TwitchDownloaderWPF/PageChatDownload.xaml @@ -74,7 +74,7 @@ (?): (?): - + @@ -117,7 +117,7 @@ - + diff --git a/TwitchDownloaderWPF/PageChatDownload.xaml.cs b/TwitchDownloaderWPF/PageChatDownload.xaml.cs index d0af3315..d03c3cf1 100644 --- a/TwitchDownloaderWPF/PageChatDownload.xaml.cs +++ b/TwitchDownloaderWPF/PageChatDownload.xaml.cs @@ -51,7 +51,7 @@ private void Page_Initialized(object sender, EventArgs e) checkBttvEmbed.IsChecked = Settings.Default.BTTVEmotes; checkFfzEmbed.IsChecked = Settings.Default.FFZEmotes; checkStvEmbed.IsChecked = Settings.Default.STVEmotes; - numChatDownloadConnections.Value = Settings.Default.ChatDownloadThreads; + NumChatDownloadThreads.Value = Settings.Default.ChatDownloadThreads; _ = (ChatFormat)Settings.Default.ChatDownloadType switch { ChatFormat.Text => radioText.IsChecked = true, @@ -260,7 +260,7 @@ public ChatDownloadOptions GetOptions(string filename) options.FfzEmotes = checkFfzEmbed.IsChecked.GetValueOrDefault(); options.StvEmotes = checkStvEmbed.IsChecked.GetValueOrDefault(); options.Filename = filename; - options.ConnectionCount = (int)numChatDownloadConnections.Value; + options.DownloadThreads = (int)NumChatDownloadThreads.Value; return options; } @@ -302,12 +302,12 @@ private void Page_Loaded(object sender, RoutedEventArgs e) btnDonate.Visibility = Settings.Default.HideDonation ? Visibility.Collapsed : Visibility.Visible; } - private void numChatDownloadConnections_ValueChanged(object sender, HandyControl.Data.FunctionEventArgs e) + private void NumChatDownloadThreads_ValueChanged(object sender, HandyControl.Data.FunctionEventArgs e) { if (this.IsInitialized) { - numChatDownloadConnections.Value = Math.Clamp((int)numChatDownloadConnections.Value, 1, 50); - Settings.Default.ChatDownloadThreads = (int)numChatDownloadConnections.Value; + NumChatDownloadThreads.Value = Math.Clamp((int)NumChatDownloadThreads.Value, 1, 50); + Settings.Default.ChatDownloadThreads = (int)NumChatDownloadThreads.Value; Settings.Default.Save(); } } diff --git a/TwitchDownloaderWPF/PageVodDownload.xaml b/TwitchDownloaderWPF/PageVodDownload.xaml index 1582b73c..5ed99359 100644 --- a/TwitchDownloaderWPF/PageVodDownload.xaml +++ b/TwitchDownloaderWPF/PageVodDownload.xaml @@ -69,7 +69,7 @@ - + (?): diff --git a/TwitchDownloaderWPF/README.md b/TwitchDownloaderWPF/README.md index 4156487e..609c06be 100644 --- a/TwitchDownloaderWPF/README.md +++ b/TwitchDownloaderWPF/README.md @@ -41,7 +41,7 @@ To get started, input a valid link or ID to a VOD or highlight. If the VOD or hi **Trim**: Sets the start and end time to trim the video download in the format \[hours\] \[minutes\] \[seconds\]. Trimming the video will result in a smaller total download. -**Download Threads**: The amount of download threads to be dispatched. +**Download Threads**: The amount of parallel download threads to be dispatched. **OAuth**: The authorization token to allow downloading sub-only and private VODs or highlights. It is required by us and Twitch in order to prevent unauthorized downloads of paid or private content. Learn how to get your OAuth token at the following video: [https://youtu.be/1MBsUoFGuls](https://www.youtube.com/watch?v=1MBsUoFGuls). **DO NOT SHARE YOUR OAUTH TOKEN WITH ANYONE** @@ -87,7 +87,7 @@ To get started, input a valid link or ID to a VOD, highlight, or clip. From ther **3rd Party Emotes** (JSON & HTML only): Also download emotes from the specified 3rd party providers and save them inside the chat. If the streamer is not registered on a given provider then it is skipped. -**Connections**: The amount of download threads to be dispatched. On some internet connections, Twitch servers may refuse using more than 1 chat download thread. +**Download Threads**: The amount of parallel download threads to be dispatched. On some internet connections, Twitch servers may refuse using more than 1 chat download thread. **Download**: Starts the download job. If instead you open the dropdown, you can send it to the [Task Queue](#task-queue) with the *Enqueue* option. The current download settings will be used in both scenarios. diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs index 956a54a0..9bb61e5b 100644 --- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs +++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs @@ -320,6 +320,15 @@ public static string ChatDownloads { } } + /// + /// Looks up a localized string similar to Download Threads:. + /// + public static string ChatDownloadThreads { + get { + return ResourceManager.GetString("ChatDownloadThreads", resourceCulture); + } + } + /// /// Looks up a localized string similar to Font:. /// @@ -554,15 +563,6 @@ public static string DownloadChat { } } - /// - /// Looks up a localized string similar to Connections:. - /// - public static string DownloadConnections { - get { - return ResourceManager.GetString("DownloadConnections", resourceCulture); - } - } - /// /// Looks up a localized string similar to Download Filename Templates:. /// @@ -590,15 +590,6 @@ public static string DownloadFormat { } } - /// - /// Looks up a localized string similar to Download Threads:. - /// - public static string DownloadThreads { - get { - return ResourceManager.GetString("DownloadThreads", resourceCulture); - } - } - /// /// Looks up a localized string similar to Download Video. /// @@ -2201,6 +2192,15 @@ public static string VideoCreatedAt { } } + /// + /// Looks up a localized string similar to Download Threads:. + /// + public static string VideoDownloadThreads { + get { + return ResourceManager.GetString("VideoDownloadThreads", resourceCulture); + } + } + /// /// Looks up a localized string similar to Title:. /// diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx index 6ad12bb7..2d82804f 100644 --- a/TwitchDownloaderWPF/Translations/Strings.es.resx +++ b/TwitchDownloaderWPF/Translations/Strings.es.resx @@ -239,8 +239,8 @@ Descarga - - Conexiones: + + Hilos de descarga: Descargar plantillas de archivos: @@ -248,7 +248,7 @@ Formato de la descarga: - + Hilos de descarga: diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx index f5460f90..f71002f3 100644 --- a/TwitchDownloaderWPF/Translations/Strings.fr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx @@ -239,7 +239,7 @@ Télécharger - + Connexions: @@ -248,7 +248,7 @@ Format de téléchargement: - + Connexions: diff --git a/TwitchDownloaderWPF/Translations/Strings.it.resx b/TwitchDownloaderWPF/Translations/Strings.it.resx index 2e2473b1..dda8cbe8 100644 --- a/TwitchDownloaderWPF/Translations/Strings.it.resx +++ b/TwitchDownloaderWPF/Translations/Strings.it.resx @@ -239,8 +239,8 @@ Scarica - - Connessioni: + + Threads di Download: Scarica i modelli di file: @@ -248,7 +248,7 @@ Formato del download: - + Threads di Download: diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx index c2da5a9a..4553235c 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pl.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx @@ -239,7 +239,7 @@ Pobierz - + Połączenia: @@ -248,7 +248,7 @@ Format Pobierania: - + Wątki Pobierania: diff --git a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx index 594f330f..29fdc25e 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx @@ -239,8 +239,8 @@ Download - - Conexões: + + Processos do Download: Templates de Nomes do Arquivo de Download: @@ -248,7 +248,7 @@ Formato de Download: - + Processos do Download: diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx index c4f2b47c..409c83fd 100644 --- a/TwitchDownloaderWPF/Translations/Strings.resx +++ b/TwitchDownloaderWPF/Translations/Strings.resx @@ -239,8 +239,8 @@ Download - - Connections: + + Download Threads: Download Filename Templates: @@ -248,7 +248,7 @@ Download Format: - + Download Threads: diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx index ef340029..13615902 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ru.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx @@ -239,7 +239,7 @@ Загрузка - + Подключения: @@ -248,7 +248,7 @@ Формат: - + Потоков: diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx index 02b72503..b561c5cb 100644 --- a/TwitchDownloaderWPF/Translations/Strings.tr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx @@ -240,7 +240,7 @@ İndir - + Bağlantılar: @@ -249,7 +249,7 @@ İndirme Formatı: - + İndirme Parçacığı: diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx index 81658c65..3cf5164c 100644 --- a/TwitchDownloaderWPF/Translations/Strings.uk.resx +++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx @@ -239,7 +239,7 @@ Завантажити - + З'єднання: @@ -248,7 +248,7 @@ Формат завантаження: - + Потоків завантаження: diff --git a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx index 9c3c3190..5c1d9ab9 100644 --- a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx +++ b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx @@ -239,7 +239,7 @@ 下载 - + 连接: @@ -248,7 +248,7 @@ 下载格式: - + 下载线程: