Esempio n. 1
0
        public Uri GetVideoStream(EpisodeInfo episode, GulliQuality quality)
        {
            string str = string.Format("http://gulli-replay-transmux.scdn.arkena.com/{0}/{0}{1}.mp4", episode.Id, quality);

            return(new Uri(str));
        }
Esempio n. 2
0
 public Uri GetVideoStream(EpisodeInfo episode) => GetVideoStream(episode, Parameters.DefaultQuality);
Esempio n. 3
0
 public PlayBack(EpisodeInfo item)
 {
     NavigationPage.SetHasNavigationBar(this, false);
     InitializeComponent();
     BindingContext = playBackViewModel = new PlayBackViewModel(item);
 }
Esempio n. 4
0
        public Exception GetEpisodeListSync(ProgramInfo program, Action <double> onProgress = null)
        {
            if (program.EnterUpdating())
            {
                try
                {
                    onProgress?.Invoke(0);

                    TableQuery <EpisodeInfo> query;
                    TableQuery <ProgramInfo> programs;
                    lock (DbLocker)
                    {
                        programs = db.Table <ProgramInfo>().Where((e) => e.Name == program.Name);
                        List <string> urls = new List <string>();
                        foreach (ProgramInfo pgm in programs)
                        {
                            urls.Add(pgm.Url);
                        }
                        query = db.Table <EpisodeInfo>().Where((e) => urls.Contains(e.ProgramUrl));
                    }

                    double progress = 0.0;
                    foreach (ProgramInfo pgm in programs)
                    {
                        Regex EpisodeRegex = new Regex(
                            @"<a href=""" + pgm.Url + @"/(VOD)?(?<vid>\d+)""><img class=""img-responsive""\s+src=""(?<img>[^""]+/img/var/storage/imports/(?<filename>[^""]+))""/><span\s+class=""title"">" +
                            @"<span>Saison (?<saison>\d+)\s*,\s*&Eacute;pisode\s*(?<episode>\d+)</span>(?<title>[^<]+)</span></a>",
                            RegexOptions.Multiline | RegexOptions.ExplicitCapture | RegexOptions.Singleline);

                        HttpWebRequest  request = HttpWebRequest.Create(pgm.Url) as HttpWebRequest;
                        string          content = request.GetContent();
                        MatchCollection matches = EpisodeRegex.Matches(content);
                        for (int i = 0; i < matches.Count; i++)
                        {
                            progress += 1.0 / matches.Count;
                            onProgress?.Invoke(progress / programs.Count());
                            Match m = matches[i];

                            string vid = m.Groups["vid"].Value;
                            var    epd = query.Where((e) => e.Id == vid);

                            EpisodeInfo episode;
                            if (epd.Count() == 0)
                            {
                                episode = new EpisodeInfo(
                                    pgm.Url,
                                    vid,
                                    WebUtility.HtmlDecode(m.Groups["title"].Value.Replace("\n", "").Trim()),
                                    GetImageUrl(m.Groups["filename"].Value),
                                    byte.Parse(m.Groups["saison"].Value),
                                    byte.Parse(m.Groups["episode"].Value));

                                DbInsert(episode);
                            }
                            else
                            {
                                episode = epd.First();
                            }

                            program.Episodes.Add(episode);
                        }
                    }
                    Debug.Write(program.Name + ": Updated");
                    program.LeaveUpdating(true);
                }
                catch (Exception e)
                {
                    Debug.Write(program.Name);
                    Debug.Write(e.Message);
                    program.LeaveUpdating(false);
                    return(e);
                }
            }
            return(null);
        }
 public PlayBackViewModel(EpisodeInfo episodeInfo)
 {
     EpisodeInfo = episodeInfo;
 }