Example #1
0
        private void parsePlayerStatus(JToken streamingData, List <KeyValuePair <string[], string> > qualities)
        {
            if (streamingData == null)
            {
                return;
            }
            var formats = streamingData["formats"] as JArray;

            if (formats == null)
            {
                string hlsUrl = streamingData.Value <String>("hlsManifestUrl");
                if (!String.IsNullOrEmpty(hlsUrl))
                {
                    var data = GetWebData(hlsUrl);
                    var res  = HlsPlaylistParser.GetPlaybackOptions(data, hlsUrl, (x, y) => x.Bandwidth.CompareTo(y.Bandwidth), (x) => x.Width + "x" + x.Height);
                    foreach (var kv in res)
                    {
                        string[] qualityKey = { "0", kv.Key };
                        qualities.Add(new KeyValuePair <string[], string>(qualityKey, kv.Value));
                    }
                }
            }
            else
            {
                foreach (var format in formats)
                {
                    string[] qualityKey   = { format.Value <String>("itag"), format.Value <String>("width") + 'x' + format.Value <String>("height") };
                    var      qualityValue = format.Value <String>("url");
                    qualities.Add(new KeyValuePair <string[], string>(qualityKey, qualityValue));
                }
            }
        }
Example #2
0
        public override string GetVideoUrl(VideoInfo video)
        {
            if (video.VideoUrl.Contains("series"))
            {
                video.VideoUrl = WebCache.Instance.GetRedirectedUrl(video.VideoUrl);
            }
            string      data = GetWebData(GetFormattedVideoUrl(video));
            XmlDocument doc  = new XmlDocument();

            doc.LoadXml(data);
            var vidUrl = doc.SelectSingleNode(@"//Clip/SourceFile").InnerText;

            if (vidUrl.ToLowerInvariant().Contains("[not-used]"))
            {
                vidUrl = doc.SelectSingleNode(@"//Clip/WebHLSMediaFiles/WebHLSMediaFile").InnerText;
                string authUrl = @"https://gatling.nelonenmedia.fi/auth/access/v2?stream=" + HttpUtility.UrlEncode(vidUrl);
                vidUrl = GetWebData(authUrl);
                data   = GetWebData(vidUrl);
                video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(data, vidUrl, (x, y) => y.Bandwidth.CompareTo(x.Bandwidth), (x) => x.Width + "x" + x.Height);
                return(video.GetPreferredUrl(true));
            }
            else
            {
                return(vidUrl);
            }
        }
Example #3
0
        public override string GetVideoUrl(VideoInfo video)
        {
            var data = GetWebData(video.VideoUrl);

            video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(data, video.VideoUrl, (x, y) => y.Bandwidth.CompareTo(x.Bandwidth), (x) => x.Width + "x" + x.Height);
            return(video.GetPreferredUrl(true));
        }
Example #4
0
        public override string GetVideoUrl(VideoInfo video)
        {
            Log.Debug(nameof(GetVideoUrl));

            if (video.Other is Context context)
            {
                var page   = context.Page;
                var result = page.GetStreams(video.VideoUrl, context.Token);


                var orderedPlaybackOptions = result.Value.OrderBy(i => (int)i.Quality)
                                             .ToLookup(s => s.Quality)
                                             .ToDictionary(i => i.Key, i => i.Select(x => x.Url));
                video.PlaybackOptions = orderedPlaybackOptions?.ToDictionary(e => e.Key.ToString(), e => e.Value.First());


                var streamUrl = video.PlaybackOptions.FirstOrDefault().Value;

                if (streamUrl?.Contains("master.m3u8") ?? false)
                {
                    var m3u8Data            = GetWebData <string>(streamUrl, cache: false);
                    var m3u8PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(m3u8Data, streamUrl);
                    video.PlaybackOptions = m3u8PlaybackOptions;
                    streamUrl             = video.PlaybackOptions.FirstOrDefault().Value;
                }
                return(streamUrl);
            }

            return(video.PlaybackOptions.FirstOrDefault().Value);
        }
Example #5
0
        public override string GetVideoUrl(VideoInfo video)
        {
            var    doc  = GetWebData <HtmlDocument>(video.VideoUrl);
            var    link = doc.DocumentNode.Descendants("a").FirstOrDefault(a => a.GetAttributeValue("data-extension", "").Contains("\"url\":\"http"));
            string bestVideoQualityUrl = string.Empty;

            if (link != null)
            {
                var json        = JObject.Parse(link.GetAttributeValue("data-extension", ""));
                var playlistUrl = json["mediaObj"].Value <string>("url");
                var f           = GetWebData(playlistUrl);
                var startIdx    = f.IndexOf('{');
                var endIdx      = f.LastIndexOf('}');
                var length      = endIdx - startIdx + 1;
                var json2       = JObject.Parse(f.Substring(startIdx, length));
                var url         = json2["mediaResource"]["alt"].Value <string>("videoURL");

                var playbackOptions = new HashSet <KeyValuePair <string, string> >(KeyValuePairComparer.KeyOrdinalIgnoreCase);
                if (url.Contains("master.m3u8"))
                {
                    url = new Uri(new Uri(playlistUrl), url).AbsoluteUri;
                    var m3u8Data            = GetWebData(url);
                    var m3u8PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(m3u8Data, video.VideoUrl);
                    playbackOptions.UnionWith(m3u8PlaybackOptions);
                    bestVideoQualityUrl = m3u8PlaybackOptions.FirstOrDefault().Value; //Default, if m3u8 playlist cannot be collected, e.g. geoblocking
                }

                video.PlaybackOptions = playbackOptions.ToDictionary(e => e.Key, e => e.Value);
            }

            return(!string.IsNullOrWhiteSpace(bestVideoQualityUrl) ? bestVideoQualityUrl : video.PlaybackOptions.LastOrDefault().Value);
        }
Example #6
0
        public override string GetVideoUrl(VideoInfo video)
        {
            JObject data = GetWebData <JObject>(video.VideoUrl);
            string  playstr;

            if (data["streams"]["medium"].Type != JTokenType.Null)
            {
                playstr = data["streams"]["medium"].Value <string>();
                if (playstr.ToLower().StartsWith("rtmp"))
                {
                    int mp4IndexFlash = playstr.ToLower().IndexOf("mp4:");
                    int mp4Index      = mp4IndexFlash >= 0 ? mp4IndexFlash : playstr.ToLower().IndexOf("flv:");
                    if (mp4Index > 0)
                    {
                        playstr = new MPUrlSourceFilter.RtmpUrl(playstr.Substring(0, mp4Index))
                        {
                            PlayPath = playstr.Substring(mp4Index), SwfUrl = redirectedSwfUrl, SwfVerify = true
                        }.ToString();
                    }
                    else
                    {
                        playstr = new MPUrlSourceFilter.RtmpUrl(playstr)
                        {
                            SwfUrl = redirectedSwfUrl, SwfVerify = true
                        }.ToString();
                    }
                }
                else if (playstr.ToLower().EndsWith(".f4m"))
                {
                    playstr += "?hdcore=3.3.0" + "&g=" + OnlineVideos.Sites.Utils.HelperUtils.GetRandomChars(12);
                }
                else if (playstr.ToLower().Contains(".f4m?"))
                {
                    playstr += "&hdcore=3.3.0" + "&g=" + OnlineVideos.Sites.Utils.HelperUtils.GetRandomChars(12);
                }
            }
            else
            {
                playstr = data["streams"]["hls"].Value <string>();
                video.PlaybackOptions = new Dictionary <string, string>();
                foreach (KeyValuePair <string, string> pair in HlsPlaylistParser.GetPlaybackOptions(GetWebData(playstr), playstr, (x, y) => y.Bandwidth.CompareTo(x.Bandwidth), (x) => x.Width + "x" + x.Height + " (" + x.Bandwidth / 1000 + " Kbps)"))
                {
                    MPUrlSourceFilter.HttpUrl httpUrl = new MPUrlSourceFilter.HttpUrl(pair.Value);
                    httpUrl.Referer   = video.VideoUrl;
                    httpUrl.UserAgent = "Mozilla/5.0 (Windows NT 6.1)";
                    video.PlaybackOptions.Add(pair.Key, httpUrl.ToString());
                }
                playstr = video.PlaybackOptions.First().Value;
            }

            if (!string.IsNullOrEmpty(video.SubtitleUrl) && string.IsNullOrEmpty(video.SubtitleText))
            {
                video.SubtitleText = GetSubtitle(video.SubtitleUrl);
            }
            return(playstr);
        }
Example #7
0
        public override String GetVideoUrl(VideoInfo video)
        {
            string bestVideoQualityUrl = string.Empty;

            if (video.PlaybackOptions == null)
            {
                if (string.IsNullOrWhiteSpace(video.VideoUrl))
                {
                    throw new OnlineVideosException("Video nicht verfügbar!");
                }

                var json            = GetWebData <JObject>(video.VideoUrl, headers: headers);
                var playbackOptions = new HashSet <KeyValuePair <string, string> >(KeyValuePairComparer.KeyOrdinalIgnoreCase);
                foreach (var formitaet in json["priorityList"].SelectMany(l => l["formitaeten"]))
                {
                    if (formitaet["facets"].Any(f => f.ToString() == "restriction_useragent"))
                    {
                        continue;
                    }

                    var type = formitaet.Value <string>("type");
                    foreach (var vid in formitaet["qualities"])
                    {
                        var quality = vid.Value <string>("quality");
                        if (quality == "auto")
                        {
                            continue;
                        }
                        var url = vid["audio"]["tracks"].First.Value <string>("uri");

                        if (url.EndsWith(".m3u8") || url.EndsWith(".webm"))
                        {
                            continue;
                        }

                        if (url.Contains("master.m3u8"))
                        {
                            var m3u8Data            = GetWebData(url);
                            var m3u8PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(m3u8Data, video.VideoUrl);
                            playbackOptions.UnionWith(m3u8PlaybackOptions);
                            bestVideoQualityUrl = m3u8PlaybackOptions.FirstOrDefault().Value; //Default, if m3u8 playlist cannot be collected, e.g. geoblocking
                        }
                        else
                        {
                            playbackOptions.Add(new KeyValuePair <string, string>(string.Format("{0}-{1}", quality, type), url));
                        }
                    }
                }

                video.PlaybackOptions = playbackOptions.ToDictionary(e => e.Key, e => e.Value);
            }

            return(!string.IsNullOrWhiteSpace(bestVideoQualityUrl) ? bestVideoQualityUrl : video.PlaybackOptions.LastOrDefault().Value);
        }
Example #8
0
        public override string GetVideoUrl(OnlineVideos.VideoInfo video)
        {
            video.PlaybackOptions = new Dictionary <string, string>();
            var    tokenDataJson  = GetWebData <JToken>(string.Format(tokenUrl, video.VideoUrl), headers: customHeader);
            var    token          = tokenDataJson["token"];
            var    sig            = tokenDataJson["sig"];
            string hlsPlaylistUrl = string.Format(playlistUrl, video.VideoUrl, HttpUtility.UrlEncode(token.ToString()), sig);
            var    m3u8Data       = GetWebData(hlsPlaylistUrl);

            video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(m3u8Data, hlsPlaylistUrl);
            return(video.GetPreferredUrl(false));
        }
Example #9
0
        public override string GetVideoUrl(VideoInfo video)
        {
            var webData = GetWebData(video.VideoUrl);
            var data    = JArray.Parse(webData);
            var ff      = data[0]["releaseUrls"].Value <String>("html");

            webData = GetWebData(ff);
            var match = Regex.Match(webData, @"<video\ssrc=""(?<url>[^""]*)""", defaultRegexOptions);

            if (match.Success)
            {
                webData = GetWebData(match.Groups["url"].Value);
                video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(webData, match.Groups["url"].Value, (x, y) => y.Bandwidth.CompareTo(x.Bandwidth), (x) => x.Width + "x" + x.Height);
            }
            return(video.GetPreferredUrl(true));
        }
Example #10
0
        public override Dictionary <string, string> GetPlaybackOptions(string url)
        {
            subtitleUrl = null;
            Dictionary <string, string> playbackOptions = new Dictionary <string, string>();
            JObject json               = GetWebData <JObject>(url);
            JArray  videoReferences    = json["videoReferences"].Value <JArray>();
            JToken  subtitleReferences = json["subtitleReferences"];
            JToken  videoReference     = videoReferences.FirstOrDefault(vr => vr["format"].Value <string>() == "hls");

            if (videoReference != null)
            {
                url             = videoReference["url"].Value <string>();
                playbackOptions = HlsPlaylistParser.GetPlaybackOptions(GetWebData(url), url, (x, y) => y.Bandwidth.CompareTo(x.Bandwidth), (x) => x.Width + "x" + x.Height + " (" + x.Bandwidth / 1000 + " Kbps)");
            }
            else
            {
                videoReference = videoReferences.FirstOrDefault(vr => vr["format"].Value <string>() == "hds");
                if (videoReference != null)
                {
                    url  = videoReference["url"].Value <string>();
                    url += url.Contains("?") ? "&" : "?";
                    url += "hdcore=3.7.0&g=" + OnlineVideos.Sites.Utils.HelperUtils.GetRandomChars(12);
                    playbackOptions.Add("HDS", url);
                }
            }
            if (playbackOptions.Count == 0)
            {
                return(playbackOptions);
            }

            if (subtitleReferences != null && subtitleReferences.Type == JTokenType.Array)
            {
                JToken subtitleReference = subtitleReferences.FirstOrDefault(sr => sr["format"].Value <string>() == "webvtt");
                if (subtitleReference != null)
                {
                    subtitleUrl = subtitleReference["url"].Value <string>();
                }
            }

            return(playbackOptions);
        }
Example #11
0
        public override List <string> GetMultipleVideoUrls(VideoInfo video, bool inPlaylist = false)
        {
            string url   = "";
            Regex  regex = new Regex(@"""HttpLiveStreaming"",""mobileUrl"":""(?<url>[^""]*)");
            Match  m     = regex.Match(GetWebData(video.VideoUrl));

            if (m.Success)
            {
                string playlistUrl = m.Groups["url"].Value;
                video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(GetWebData(playlistUrl), playlistUrl, (x, y) => y.Bandwidth.CompareTo(x.Bandwidth), (x) => "Bitrate: " + x.Bandwidth);
                url = video.PlaybackOptions.First().Value;
                if (inPlaylist)
                {
                    video.PlaybackOptions.Clear();
                }
            }
            return(new List <string>()
            {
                url
            });
        }
Example #12
0
        public override List <string> GetMultipleVideoUrls(VideoInfo video, bool inPlaylist = false)
        {
            video.PlaybackOptions = new Dictionary <string, string>();
            string videoUrl = video.VideoUrl;

            if (videoUrl.EndsWith(".m3u8"))
            {
                video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(GetWebData(videoUrl), videoUrl, (x, y) => y.Bandwidth.CompareTo(x.Bandwidth), (x) => x.Width + "x" + x.Height + " (" + x.Bandwidth / 1000 + " Kbps)");
            }
            else
            {
                HosterBase hoster = HosterFactory.GetAllHosters().FirstOrDefault <HosterBase>((HosterBase h) => videoUrl.ToLower().Contains(h.GetHosterUrl().ToLower()));
                if (hoster != null)
                {
                    video.PlaybackOptions = hoster.GetPlaybackOptions(videoUrl);
                    if (hoster is ISubtitle)
                    {
                        video.SubtitleText = (hoster as ISubtitle).SubtitleText;
                    }
                }
            }
            if (video.PlaybackOptions.Count == 0)
            {
                return(new List <string>());
            }
            if (video.HasDetails && (video as DetailVideoInfo).Title2 == "Live")
            {
                video.PlaybackOptions = video.PlaybackOptions.ToDictionary(p => p.Key, p => p.Value.Replace("start=", "dummy="));
            }
            string url = video.PlaybackOptions.First <KeyValuePair <string, string> >().Value;

            if (inPlaylist)
            {
                video.PlaybackOptions.Clear();
            }
            return(new List <string>()
            {
                url
            });
        }
Example #13
0
        public override string GetVideoUrl(VideoInfo video)
        {
            string postData = "loginID=" + userName + "&password="******"&APIKey=3_qhEcPa5JGFROVwu5SWKqJ4mVOIkwlFNMSKwzPDAh8QZOtHqu6L4nD5Q7lk0eXOOG&targetEnv=jssdk&includeSSOToken=true&authMode=cookie";
            var    res      = GetWebData <JToken>("https://accounts.eu1.gigya.com/accounts.login", postData);
            var    uid      = res.Value <String>("UID");
            var    sig      = res.Value <String>("UIDSignature");
            var    ts       = res.Value <String>("signatureTimestamp");

            postData = @"{""uid"": """ + uid + @""", ""uidsig"": """ + sig + @""", ""ts"": """ + ts + @""", ""email"": """ + userName + @"""}";

            var headers = new NameValueCollection();

            headers["Content-Type"] = "application/json";
            headers["Accept"]       = "*/*";
            headers["User-Agent"]   = OnlineVideoSettings.Instance.UserAgent;

            var cc = new CookieContainer();

            GetWebData(@"https://token.vrt.be", postData, referer: "https://www.vrt.be/vrtnu/", headers: headers, cookies: cc);
            var url  = video.VideoUrl.TrimEnd('/') + ".mssecurevideo.json";
            var resp = GetWebData <JToken>(url, cookies: cc);

            url  = @"https://mediazone.vrt.be/api/v1/vrtvideo/assets/" + resp.First.First.Value <String>("videoid");
            resp = GetWebData <JToken>(url);
            string hlsUrl = null;

            foreach (var src in resp["targetUrls"])
            {
                if (src.Value <String>("type") == "HLS")
                {
                    hlsUrl = src.Value <String>("url");
                }
            }

            var data = GetWebData(hlsUrl);

            video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(data, hlsUrl);
            return(video.GetPreferredUrl(true));
        }
        public override String GetVideoUrl(VideoInfo video)
        {
            var    baseDoc             = WebCache.Instance.ReadAsHtmlDocument(video.VideoUrl);
            var    mediaDiv            = baseDoc.DocumentNode.Descendants("div").FirstOrDefault(div => div.GetAttributeValue("data-ctrl-player", "") != "");
            string bestVideoQualityUrl = string.Empty;

            if (mediaDiv != null)
            {
                var configUrl       = new Uri(new Uri(video.VideoUrl), JObject.Parse(HttpUtility.HtmlDecode(mediaDiv.GetAttributeValue("data-ctrl-player", ""))).Value <string>("mcUrl")).AbsoluteUri;
                var mediaJson       = WebCache.Instance.ReadAs <JsonResponse>(configUrl);
                var playbackOptions = new HashSet <KeyValuePair <string, string> >(KeyValuePairComparer.KeyOrdinalIgnoreCase);
                int qualityNumber;
                foreach (var media in mediaJson.MediaArray.SelectMany(m => m.MediaStreamArray).Select(streamArray => new
                {
                    Quality = int.TryParse(streamArray.Quality, out qualityNumber) ? ((VideoQuality)qualityNumber).ToString() : "HD",
                    Url = streamArray.Stream is JArray ? ((JArray)streamArray.Stream).Values <string>().OrderByDescending(item => item, StringComparer.OrdinalIgnoreCase).First() : streamArray.Stream as string,
                    Server = streamArray.Server
                }).Distinct())
                {
                    string url = media.Url;
                    if (url.EndsWith(".smil"))
                    {
                        url = GetStreamUrlFromSmil(url);
                    }

                    if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
                    {
                        if (Uri.IsWellFormedUriString(url, UriKind.Relative))
                        {
                            var absoluteUri = new Uri(new Uri(video.VideoUrl), url);
                            url = absoluteUri.ToString();
                        }

                        if (url.Contains("master.m3u8"))
                        {
                            var newUrl              = WebCache.Instance.GetRedirectedUrl(url);
                            var m3u8Data            = WebCache.Instance.ReadAsString(newUrl);
                            var m3u8PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(m3u8Data, newUrl);
                            playbackOptions.UnionWith(m3u8PlaybackOptions);
                            bestVideoQualityUrl = m3u8PlaybackOptions.FirstOrDefault().Value; //Default, if m3u8 playlist cannot be collected, e.g. geoblocking
                        }
                        else
                        {
                            if (url.EndsWith("f4m"))
                            {
                                url += "?g=" + StringUtils.GetRandomLetters(12) + "&hdcore=3.8.0";
                            }
                            playbackOptions.Add(new KeyValuePair <string, string>(media.Quality, url));
                        }
                    }
                    else if (mediaJson.IsLive)
                    {
                        url = string.Empty;
                        if (string.IsNullOrEmpty(media.Url))
                        {
                            string guessedStream = media.Server.Substring(media.Server.LastIndexOf('/') + 1);
                            url = new MPUrlSourceFilter.RtmpUrl(media.Server)
                            {
                                Live = true, LiveStream = true, Subscribe = guessedStream, PageUrl = video.VideoUrl
                            }.ToString();
                        }
                        else if (media.Url.Contains('?'))
                        {
                            var tcUrl    = media.Server.TrimEnd('/') + media.Url.Substring(media.Url.IndexOf('?'));
                            var app      = new Uri(media.Server).AbsolutePath.Trim('/') + media.Url.Substring(media.Url.IndexOf('?'));
                            var playPath = media.Url;
                            url = new MPUrlSourceFilter.RtmpUrl(tcUrl)
                            {
                                App = app, PlayPath = playPath, Live = true, PageUrl = video.VideoUrl, Subscribe = playPath
                            }.ToString();
                        }
                        else
                        {
                            url = new MPUrlSourceFilter.RtmpUrl(media.Server + "/" + media.Url)
                            {
                                Live = true, LiveStream = true, Subscribe = media.Url, PageUrl = video.VideoUrl
                            }.ToString();
                        }

                        playbackOptions.Add(new KeyValuePair <string, string>(media.Quality, url));
                    }
                }

                video.PlaybackOptions = playbackOptions.ToDictionary(e => e.Key, e => e.Value);
            }

            return(!string.IsNullOrWhiteSpace(bestVideoQualityUrl) ? bestVideoQualityUrl : video.PlaybackOptions.LastOrDefault().Value);
        }
Example #15
0
        public override string GetVideoUrl(VideoInfo video)
        {
            string  url         = string.Format("http://player.yle.fi/api/v1/media.jsonp?protocol=HDS&client=areena-flash-player&id={0}", video.VideoUrl);
            string  subtitleUrl = string.Empty;
            JObject json        = GetWebData <JObject>(url, cache: false);
            JToken  hdsStream   = json["data"]["media"]["HDS"].FirstOrDefault(h => h["subtitles"] != null && h["subtitles"].Count() > 0);

            if (hdsStream == null)
            {
                hdsStream = json["data"]["media"]["HDS"].First;
            }
            else
            {
                JToken subtitle = hdsStream["subtitles"].FirstOrDefault(s => s["lang"].Value <string>() == ApiLanguage);
                if (subtitle == null && ApiLanguage == "fi")
                {
                    subtitle = hdsStream["subtitles"].FirstOrDefault(s => s["lang"].Value <string>() == "fih");                                         //Hearing impaired
                }
                if (subtitle == null)
                {
                    subtitle = hdsStream["subtitles"].FirstOrDefault(s => s["lang"].Value <string>() == ApiOtherLanguage);
                }
                if (subtitle != null && subtitle["uri"] != null)
                {
                    subtitleUrl = subtitle["uri"].Value <string>();
                }
            }
            if (!string.IsNullOrEmpty(subtitleUrl))
            {
                video.SubtitleText = GetWebData(subtitleUrl, encoding: Encoding.UTF8, forceUTF8: true);
            }
            string data   = hdsStream["url"].Value <string>();
            string result = DecryptData(data);
            Regex  r;
            bool   useHls = !result.Contains(".f4m") && !result.Contains("*~hmac");

            if (useHls)
            {
                url    = string.Format("http://player.yle.fi/api/v1/media.jsonp?protocol=HLS&client=areena-flash-player&id={0}", video.VideoUrl);
                json   = GetWebData <JObject>(url, cache: false);
                data   = json["data"]["media"]["HLS"].First["url"].Value <string>();
                result = DecryptData(data);
                r      = new Regex(@"(?<url>.*\.m3u8)");
                Match m = r.Match(result);
                if (m.Success)
                {
                    result = m.Groups["url"].Value;
                    video.PlaybackOptions = HlsPlaylistParser.GetPlaybackOptions(GetWebData(result), result);
                    result = video.PlaybackOptions.Last().Value;
                }
            }
            else
            {
                r = new Regex(@"(?<url>.*hmac=[a-z0-9]*)");
                Match m = r.Match(result);
                if (m.Success)
                {
                    result = m.Groups["url"].Value + "&g=" + HelperUtils.GetRandomChars(12) + "&hdcore=3.8.0&plugin=flowplayer-3.8.0.0";
                }
            }
            return(result);
        }