只需使用的HttpWebRequest或Web客戶端:
public string ResolveStreamcloud(string url)
{
var client = new WebClient();
var reqParams = new NameValueCollection();
var response = client.DownloadString(url);
var regexObj = new Regex("<input.*?name=\"(.*?)\".*?value=\"(.*?)\">", RegexOptions.Singleline);
var matchResults = regexObj.Match(response);
while (matchResults.Success)
{
reqParams.Add(matchResults.Groups[1].Value, matchResults.Groups[2].Value);
matchResults = matchResults.NextMatch();
}
Thread.Sleep(10500);
byte[] responsebytes = client.UploadValues(url, "POST", reqParams);
string responsebody = Encoding.UTF8.GetString(responsebytes);
string resolved = Regex.Match(responsebody, "file: \"(.+?)\",", RegexOptions.Singleline).Groups[1].Value;
if (!String.IsNullOrEmpty(resolved))
{
return resolved;
}
else
{
throw new Exception("File not found!");
}
}
什麼是StreamCloud?只是搜索了一下,並不清楚你使用的是哪種服務。 –
您是否嘗試過使用Fiddler捕獲點擊該按鈕時發生的http流量?你可能只能複製它。 –
1. Streamcloud是一個視頻webhoster 2.不,我沒有試過這個。當我有時間時,我會這樣做。 – Link