public UserDetails getUserDetails(string username)
{
var url = apiUrl + "/api/users/" + username + ".json";
var response = executeRequest(url);
var jo = (JObject)JsonConvert.DeserializeObject(response);
var details = new UserDetails
{
videoCount = String.IsNullOrEmpty(jo["video_count"].ToString()) ? 0 : Int64.Parse(jo["video_count"].ToString()),
videosTotalSize = String.IsNullOrEmpty(jo["video_total_size"].ToString()) ? 0 : Int64.Parse(jo["video_total_size"].ToString()),
maxFileSize = String.IsNullOrEmpty(jo["max_file_size"].ToString()) ? 0 : Int64.Parse(jo["max_file_size"].ToString()),
playCount = String.IsNullOrEmpty(jo["play_count"].ToString()) ? 0 : Int64.Parse(jo["play_count"].ToString()),
version = (string)jo["version"],
authorId = String.IsNullOrEmpty(jo["author_id"].ToString()) ? 0 : int.Parse(jo["author_id"].ToString()),
authorAccountTitle = (string)jo["author_account_title"],
authorName = (string)jo["author_name"],
authorAccount = String.IsNullOrEmpty(jo["author_account"].ToString()) ? 0 : int.Parse(jo["author_account"].ToString()),
authorUrl = (string)jo["author_url"],
createdAt = DateTime.Parse((string)jo["created_at"]),
bandwidthThisMonth = String.IsNullOrEmpty(jo["bandwidth_this_month"].ToString()) ? 0 : Int64.Parse(jo["bandwidth_this_month"].ToString())
};
var bandwidth = new List<UserBandwidthDetails>();
JsonConvert.PopulateObject(jo["bandwidth"].ToString(), bandwidth);
details.bandwidth = bandwidth;
return details;
}