You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
目前只下载了第一页,改了一下把所有都下载,望采纳
private static List SearchCollect(string id, int page)
{
List result = new List();
while (true)
{
var url = "http://m.kugou.com/plist/list/?specialid=" + id + "&page=" + page + "&plat=2&json=true";
var html = CommonHelper.GetHtmlContent(url);
if (string.IsNullOrEmpty(html) || html == "null")
{
return null;
}
var json = JObject.Parse(html);
int total = int.Parse(json["list"]["list"]["total"].ToString());
int pagesize = int.Parse(json["list"]["pagesize"].ToString());
page = int.Parse(json["list"]["page"].ToString());
if (json["list"]["list"]["total"].ToString() == "0")
{
return null;
}
try
{
var datas = json["list"]["list"]["info"];
result.AddRange(GetListByJson(datas));
}
catch (Exception ex)
{
CommonHelper.AddLog(ex.ToString());
return null;
}
page++;
if (page * pagesize > total)
break;
}
return result;
}
The text was updated successfully, but these errors were encountered:
目前只下载了第一页,改了一下把所有都下载,望采纳
private static List SearchCollect(string id, int page)
{
List result = new List();
while (true)
{
var url = "http://m.kugou.com/plist/list/?specialid=" + id + "&page=" + page + "&plat=2&json=true";
var html = CommonHelper.GetHtmlContent(url);
if (string.IsNullOrEmpty(html) || html == "null")
{
return null;
}
var json = JObject.Parse(html);
The text was updated successfully, but these errors were encountered: