From 81a6f0fdd5e55f6c6d45ed56849489002b02e558 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sat, 21 Feb 2026 00:08:47 -0600 Subject: [PATCH] Total Cloudflare Death --- KfChatDotNetBot/Services/RainbetWs.cs | 6 ++++-- KfChatDotNetBot/Settings/BuiltIn.cs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Services/RainbetWs.cs b/KfChatDotNetBot/Services/RainbetWs.cs index 699da37..e3aa7f6 100644 --- a/KfChatDotNetBot/Services/RainbetWs.cs +++ b/KfChatDotNetBot/Services/RainbetWs.cs @@ -39,12 +39,14 @@ public class RainbetWs : IDisposable private async Task CreateWsClient() { + var cookies = + (await SettingsProvider.GetValueAsync(BuiltIn.Keys.RainbetCookies)).JsonDeserialize>(); var factory = new Func(() => { var clientWs = new ClientWebSocket(); clientWs.Options.SetRequestHeader("Origin", "https://rainbet.com"); - clientWs.Options.SetRequestHeader("User-Agent", _userAgent); - //clientWs.Options.SetRequestHeader("Cookie", string.Join("; ", _cookies!)); + clientWs.Options.SetRequestHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"); + clientWs.Options.SetRequestHeader("Cookie", string.Join("; ", cookies!)); if (_proxy == null) return clientWs; _logger.Debug($"Using proxy address {_proxy}"); clientWs.Options.Proxy = new WebProxy(_proxy); diff --git a/KfChatDotNetBot/Settings/BuiltIn.cs b/KfChatDotNetBot/Settings/BuiltIn.cs index 06efd62..36a7c0f 100644 --- a/KfChatDotNetBot/Settings/BuiltIn.cs +++ b/KfChatDotNetBot/Settings/BuiltIn.cs @@ -547,6 +547,8 @@ public static class BuiltIn public static string BotImageRehostEnabled = "Bot.Image.RehostEnabled"; [BuiltInSetting("Domain to look for when determining whether to rehost", SettingValueType.Text, "i.ddos.lgbt")] public static string BotImageRehostDomain = "Bot.Image.RehostDomain"; + [BuiltInSetting("Array of cookies as a shitty hack to get Rainbet going", SettingValueType.Array, "[]")] + public static string RainbetCookies = "Rainbet.Cookies"; } }