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"; } }