diff --git a/CollectionManagerExtensionsDll/Modules/DownloadManager/API/CookieAwareWebClient.cs b/CollectionManagerExtensionsDll/Modules/DownloadManager/API/CookieAwareWebClient.cs index c417895..96dde0f 100644 --- a/CollectionManagerExtensionsDll/Modules/DownloadManager/API/CookieAwareWebClient.cs +++ b/CollectionManagerExtensionsDll/Modules/DownloadManager/API/CookieAwareWebClient.cs @@ -17,9 +17,9 @@ public bool Login(string loginPageAddress, string loginData) { var homePageRequest = (HttpWebRequest)WebRequest.Create("https://osu.ppy.sh/home"); homePageRequest.CookieContainer = CookieContainer; - homePageRequest.GetResponse(); - var token = CookieContainer.ToList().First(x => x.Name == "XSRF-TOKEN"); - + var homeResponse = (HttpWebResponse)homePageRequest.GetResponse(); + var token = homeResponse.Cookies["XSRF-TOKEN"].Value; + var request = (HttpWebRequest)WebRequest.Create(loginPageAddress); request.Method = "POST";