Skip to content

Instantly share code, notes, and snippets.

@bdbai
Created May 14, 2016 16:13
Show Gist options
  • Save bdbai/0c32c24d393290b709293c5fd5c8a0f1 to your computer and use it in GitHub Desktop.
Save bdbai/0c32c24d393290b709293c5fd5c8a0f1 to your computer and use it in GitHub Desktop.
Youku speed up claiming
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
namespace HttpWebRequestDemo
{
class Program
{
async static Task<int> Run(string user, string pass) {
HttpClient client = new HttpClient();
Dictionary<string, string> loginDict= new Dictionary<string, string>();
loginDict.Add("passport", user);
loginDict.Add("password", pass);
loginDict.Add("captcha", "");
loginDict.Add("remember", "1");
loginDict.Add("callback", "logincallback_d");
loginDict.Add("from", "http://login.youku.com/@@@@");
loginDict.Add("wintype", "page");
FormUrlEncodedContent loginContent = new FormUrlEncodedContent(loginDict);
HttpResponseMessage response = await client.PostAsync("https://login.youku.com/user/login_submit/", loginContent);
await client.GetAsync(response.Headers.Location);
response = await client.PostAsync("http://vip.youku.com/?c=ajax&a=ajax_do_speed_up", new StringContent(""));
Console.WriteLine(await response.Content.ReadAsStringAsync());
return 0;
}
static void Main(string[] args)
{
Task.Run(async () => {
await Run("[email protected]", "nidemima");
}).Wait();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment