Fixed ~ani and ~mang, searches might be off for some time

This commit is contained in:
Kwoth 2017-02-28 14:42:26 +01:00
parent 500e128d42
commit d58ebd100f

View File

@ -30,7 +30,8 @@ namespace NadekoBot.Modules.Searches
{ {
try try
{ {
var headers = new Dictionary<string, string> { var headers = new Dictionary<string, string>
{
{"grant_type", "client_credentials"}, {"grant_type", "client_credentials"},
{"client_id", "kwoth-w0ki9"}, {"client_id", "kwoth-w0ki9"},
{"client_secret", "Qd6j4FIAi1ZK6Pc7N7V4Z"}, {"client_secret", "Qd6j4FIAi1ZK6Pc7N7V4Z"},
@ -38,9 +39,10 @@ namespace NadekoBot.Modules.Searches
using (var http = new HttpClient()) using (var http = new HttpClient())
{ {
http.AddFakeHeaders(); //http.AddFakeHeaders();
http.DefaultRequestHeaders.Clear();
var formContent = new FormUrlEncodedContent(headers); var formContent = new FormUrlEncodedContent(headers);
var response = await http.PostAsync("http://anilist.co/api/auth/access_token", formContent).ConfigureAwait(false); var response = await http.PostAsync("https://anilist.co/api/auth/access_token", formContent).ConfigureAwait(false);
var stringContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var stringContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
anilistToken = JObject.Parse(stringContent)["access_token"].ToString(); anilistToken = JObject.Parse(stringContent)["access_token"].ToString();
} }