public override string GetVideoUrl(VideoInfo video)
{
CookieContainer newCc = new CookieContainer();
foreach (Cookie c in cc.GetCookies(new Uri(@"https://www.filmon.com/")))
{
newCc.Add(c);
}
NameValueCollection headers = new NameValueCollection();
headers.Add("Accept", "*/*");
headers.Add("User-Agent", userAgent);
headers.Add("X-Requested-With", "XMLHttpRequest");
string webdata = GetWebData(video.VideoUrl, (string)video.Other, newCc, headers: headers);
JToken jt = JObject.Parse(webdata) as JToken;
JArray streams = jt.Value<JArray>("streams");
video.PlaybackOptions = new Dictionary<string, string>();
foreach (JToken stream in streams)
{
string serverUrl = stream.Value<string>("url");
RtmpUrl res = new RtmpUrl(serverUrl);
res.Live = true;
res.PlayPath = stream.Value<string>("name");
int p = serverUrl.IndexOf("live/?id");
res.App = serverUrl.Substring(p);
video.PlaybackOptions.Add(stream.Value<string>("quality"), res.ToString());
}
return video.PlaybackOptions.First().Value;
}