Fix - Hotfix calendar not loading
This commit is contained in:
parent
aee8a20450
commit
4e98b64527
|
@ -10,7 +10,6 @@ using System.Net.Http;
|
|||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Avalonia.Media;
|
||||
using CRD.Utils;
|
||||
|
@ -245,10 +244,8 @@ public class Crunchyroll{
|
|||
|
||||
var request = HttpClientReq.CreateRequestMessage($"{calendarLanguage[CrunOptions.SelectedCalendarLanguage ?? "de"]}?filter=premium&date={weeksMondayDate}", HttpMethod.Get, false, false, null);
|
||||
|
||||
request.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36");
|
||||
request.Headers.AcceptEncoding.ParseAdd("gzip, deflate");
|
||||
request.Headers.AcceptLanguage.ParseAdd("en-US,en;q=0.9");
|
||||
request.Headers.Referrer = new Uri("https://www.crunchyroll.com/");
|
||||
request.Headers.Accept.ParseAdd("text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8");
|
||||
request.Headers.AcceptEncoding.ParseAdd("gzip, deflate, br");
|
||||
|
||||
var response = await HttpClientReq.Instance.SendHttpRequest(request);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class HttpClientReq{
|
|||
handler = new HttpClientHandler();
|
||||
handler.CookieContainer = new CookieContainer();
|
||||
handler.UseCookies = true;
|
||||
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
|
||||
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate | DecompressionMethods.Brotli;
|
||||
|
||||
// Initialize the HttpClient with the handler
|
||||
client = new HttpClient(handler);
|
||||
|
@ -77,7 +77,8 @@ public class HttpClientReq{
|
|||
|
||||
return (IsOk: true, ResponseContent: content);
|
||||
} catch (Exception e){
|
||||
Console.Error.WriteLine($"Error: {e} \n Response: {(content.Length < 500 ? content : "error to long")}");
|
||||
// Console.Error.WriteLine($"Error: {e} \n Response: {(content.Length < 500 ? content : "error to long")}");
|
||||
Console.Error.WriteLine($"Error: {e} \n Response: {content}");
|
||||
return (IsOk: false, ResponseContent: content);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue