public List <DetailVideoInfo> GetVideoChoices(VideoInfo video) { List <DetailVideoInfo> videos = new List <DetailVideoInfo>(); videos.Add(new DetailVideoInfo(video) { Title2 = "Full Movie" }); if (video.Other.GetType() == typeof(TMDbVideoDetails)) { TMDbVideoDetails videoDetail = (TMDbVideoDetails)video.Other; foreach (TMDB.Trailer trailer in videoDetail.TMDbDetails.videos.TrailerList()) { var clip = new DetailVideoInfo(); clip.Description = videoDetail.TMDbDetails.overview; clip.Thumb = videoDetail.TMDbDetails.PosterPathFullUrl(); clip.Title = string.Format("{0} – {1}", video.Title, trailer.name); clip.Airdate = videoDetail.TMDbDetails.ReleaseDateAsString(); clip.Title2 = trailer.name; clip.VideoUrl = "https://www.youtube.com/watch?v=" + trailer.key; videos.Add(clip); } } return(videos); }
List <DetailVideoInfo> IChoice.GetVideoChoices(VideoInfo video) { string url = baseUrl + video.VideoUrl.Replace("/film/", "/play/"); List <DetailVideoInfo> choices = new List <DetailVideoInfo>(); HtmlDocument data = GetWebData <HtmlDocument>(url); HtmlNode doc = data.DocumentNode; url = doc.SelectSingleNode("//source").GetAttributeValue("src", ""); DetailVideoInfo detailNoSub = new DetailVideoInfo(); detailNoSub.Title = video.Title; detailNoSub.Thumb = video.Thumb; detailNoSub.VideoUrl = url; detailNoSub.Title2 = "Ingen textning"; choices.Add(detailNoSub); foreach (HtmlNode track in doc.SelectNodes("//track")) { DetailVideoInfo detail = new DetailVideoInfo(); detail.Title = video.Title; detail.Thumb = video.Thumb; detail.VideoUrl = url; detail.Title2 = "Textning: " + track.GetAttributeValue("label", ""); string sub = GetWebData(baseUrl + track.GetAttributeValue("src", "")); string[] lines = Regex.Split(sub, "\n").Skip(1).ToArray(); detail.SubtitleText = string.Join("\n", lines); choices.Add(detail); } return(choices); }
List <DetailVideoInfo> IChoice.GetVideoChoices(VideoInfo video) { List <DetailVideoInfo> videos = new List <DetailVideoInfo>(); DetailVideoInfo live = new DetailVideoInfo(video); live.Title2 = "Live"; videos.Add(live); DetailVideoInfo fromStart = new DetailVideoInfo(video); fromStart.Title2 = "Spela upp sändningen från början"; videos.Add(fromStart); return(videos); }
List <DetailVideoInfo> IChoice.GetVideoChoices(VideoInfo video) { DrakenVideo dv = video as DrakenVideo; DetailVideoInfo movie = new DetailVideoInfo(video); movie.Title2 = dv.Title + (HaveCredentials ? string.Empty : " [Inloggning krävs]"); DetailVideoInfo trailer = new DetailVideoInfo(video); trailer.Title2 = "Trailer"; trailer.VideoUrl = dv.TrailerUrl; List <DetailVideoInfo> videos = new List <DetailVideoInfo>() { movie, trailer }; return(videos); }
public List <DetailVideoInfo> GetVideoChoices(VideoInfo video) { List <DetailVideoInfo> clips = new List <DetailVideoInfo>(); // make the movie request Movie movie = video.Other as Movie; if (movie == null) { movie = apiSession.Get <Movie>(video.VideoUrl); video.Other = movie; } NodeResult result = movie.Update(); if (movie.State == NodeState.Complete) { // complete movie metadata video.Description = movie.Plot; video.Length = movie.ReleaseDate != DateTime.MinValue ? movie.ReleaseDate.ToShortDateString() : "Coming Soon"; video.Thumb = movie.Poster != null ? movie.Poster.Large : string.Empty; video.VideoUrl = movie.Uri; } // get initial video list foreach (Video clip in movie.Videos) { DetailVideoInfo vid = new DetailVideoInfo(); vid.Other = clip; vid.Title = movie.Title + " - " + clip.Title; vid.Title2 = clip.Title; vid.Description = movie.Plot; //vid.Length = clip.Duration.ToString(); vid.Length = clip.Published != DateTime.MinValue ? clip.Published.ToShortDateString() : "N/A"; vid.Thumb = !string.IsNullOrEmpty(clip.ThumbUrl) ? clip.ThumbUrl : (movie.Poster != null ? movie.Poster.Uri : string.Empty); //vid.ThumbnailImage = video.ThumbnailImage; vid.VideoUrl = clip.Uri; clips.Add(vid); } return(clips); }
public List <DetailVideoInfo> GetVideoChoices(VideoInfo video) { List <DetailVideoInfo> clips = new List <DetailVideoInfo>(); TitleDetails title = IMDbAPI.GetTitle(apiSession, video.VideoUrl as string); video.Other = title; video.Title = title.Title; video.Description = title.Plot; if (!string.IsNullOrEmpty(title.Image)) { video.Thumb = getResizedImage(title.Image); } List <VideoReference> videos = title.GetVideos(); if (videos != null) { foreach (VideoReference clip in videos) { if (clip.Description == null) { clip.Description = video.Description; } DetailVideoInfo vid = new DetailVideoInfo(); vid.Other = clip; vid.Title = title.Title + " - " + clip.Title; vid.Title2 = clip.Title; vid.Description = clip.Description; vid.Thumb = clip.Image; vid.VideoUrl = clip.ID; vid.Length = clip.Duration.ToString(); clips.Add(vid); } } return(clips); }
public List<DetailVideoInfo> GetVideoChoices(VideoInfo video) { List<DetailVideoInfo> videos = new List<DetailVideoInfo>(); videos.Add(new DetailVideoInfo(video) { Title2 = "Full Movie" }); if (video.Other.GetType() == typeof(TMDbVideoDetails)) { TMDbVideoDetails videoDetail = (TMDbVideoDetails)video.Other; foreach (TMDB.Trailer trailer in videoDetail.TMDbDetails.videos.TrailerList()) { var clip = new DetailVideoInfo(); clip.Description = videoDetail.TMDbDetails.overview; clip.Thumb = videoDetail.TMDbDetails.PosterPathFullUrl(); clip.Title = string.Format("{0} – {1}", video.Title, trailer.name); clip.Airdate = videoDetail.TMDbDetails.ReleaseDateAsString(); clip.Title2 = trailer.name; clip.VideoUrl = "https://www.youtube.com/watch?v=" + trailer.key; videos.Add(clip); } } return videos; }
List<DetailVideoInfo> IChoice.GetVideoChoices(VideoInfo video) { string url = baseUrl + video.VideoUrl.Replace("/film/", "/play/"); List<DetailVideoInfo> choices = new List<DetailVideoInfo>(); HtmlDocument data = GetWebData<HtmlDocument>(url); HtmlNode doc = data.DocumentNode; url = doc.SelectSingleNode("//source").GetAttributeValue("src", ""); DetailVideoInfo detailNoSub = new DetailVideoInfo(); detailNoSub.Title = video.Title; detailNoSub.Thumb = video.Thumb; detailNoSub.VideoUrl = url; detailNoSub.Title2 = "Ingen textning"; choices.Add(detailNoSub); foreach (HtmlNode track in doc.SelectNodes("//track")) { DetailVideoInfo detail = new DetailVideoInfo(); detail.Title = video.Title; detail.Thumb = video.Thumb; detail.VideoUrl = url; detail.Title2 = "Textning: " + track.GetAttributeValue("label", ""); string sub = GetWebData(baseUrl + track.GetAttributeValue("src", "")); string[] lines = Regex.Split(sub, "\n").Skip(1).ToArray(); detail.SubtitleText = string.Join("\n", lines); choices.Add(detail); } return choices; }
public List<DetailVideoInfo> GetVideoChoices(VideoInfo video) { List<DetailVideoInfo> clips = new List<DetailVideoInfo>(); TitleDetails title = IMDbAPI.GetTitle(apiSession, video.VideoUrl as string); video.Other = title; video.Title = title.Title; video.Description = title.Plot; if (!string.IsNullOrEmpty(title.Image)) video.Thumb = getResizedImage(title.Image); List<VideoReference> videos = title.GetVideos(); if (videos != null) { foreach (VideoReference clip in videos) { if (clip.Description == null) clip.Description = video.Description; DetailVideoInfo vid = new DetailVideoInfo(); vid.Other = clip; vid.Title = title.Title + " - " + clip.Title; vid.Title2 = clip.Title; vid.Description = clip.Description; vid.Thumb = clip.Image; vid.VideoUrl = clip.ID; vid.Length = clip.Duration.ToString(); clips.Add(vid); } } return clips; }
public OnlineVideosGuiListItem(DetailVideoInfo item) : this((VideoInfo)item) { Label = item.Title2; }
List<VideoInfo> getVideos(string url, bool findOuterOL, bool fromSearch = false) { HasNextPage = false; var result = new List<VideoInfo>(); var html = GetWebData<HtmlDocument>(url); var ol = findOuterOL ? html.DocumentNode.Descendants("ol").First() : html.DocumentNode; foreach (var li in ol.Elements("li")) { if (fromSearch) { var video = new RbbVideoInfo() { Title = li.Descendants("h3").First().InnerText.Trim(), HasDetails = false }; FillVideoInfoFromLI(li, video, true); if (!string.IsNullOrEmpty(video.VideoUrl)) result.Add(video); } else { var sub_ol = li.Elements("ol").FirstOrDefault(); if (sub_ol != null) { var video = new RbbVideoInfo() { Title = li.Descendants("h3").First().InnerText.Trim() }; var sub_lis = sub_ol.Elements("li"); if (sub_lis.Count() == 1) // Sendung hat nur einen Beitrag { video.HasDetails = false; FillVideoInfoFromLI(li, video, true); if (!string.IsNullOrEmpty(video.VideoUrl)) result.Add(video); } else // Sendung hat einzelne Beiträge { //video.ImageUrl = category.Thumb; foreach (var sub_li in sub_lis) { var subVideo = new DetailVideoInfo() { Title = video.Title }; FillVideoInfoFromLI(sub_li, subVideo, false); subVideo.Length = subVideo.Length.Replace("min", "").Trim(); if (!string.IsNullOrEmpty(subVideo.VideoUrl)) video.Children.Add(subVideo); } if (video.Children.Count > 0) result.Add(video); } } } } var nextPageLink = html.DocumentNode.Descendants("a").Where(a => a.InnerText == "Weiter").FirstOrDefault(); if (nextPageLink != null) { HasNextPage = true; nextPageUrl = "http://mediathek.rbb-online.de" + nextPageLink.GetAttributeValue("href", ""); } return result; }
List <VideoInfo> getVideos(string url, bool findOuterOL, bool fromSearch = false) { HasNextPage = false; var result = new List <VideoInfo>(); var html = GetWebData <HtmlDocument>(url); var ol = findOuterOL ? html.DocumentNode.Descendants("ol").First() : html.DocumentNode; foreach (var li in ol.Elements("li")) { if (fromSearch) { var video = new RbbVideoInfo() { Title = li.Descendants("h3").First().InnerText.Trim(), HasDetails = false }; FillVideoInfoFromLI(li, video, true); if (!string.IsNullOrEmpty(video.VideoUrl)) { result.Add(video); } } else { var sub_ol = li.Elements("ol").FirstOrDefault(); if (sub_ol != null) { var video = new RbbVideoInfo() { Title = li.Descendants("h3").First().InnerText.Trim() }; var sub_lis = sub_ol.Elements("li"); if (sub_lis.Count() == 1) // Sendung hat nur einen Beitrag { video.HasDetails = false; FillVideoInfoFromLI(li, video, true); if (!string.IsNullOrEmpty(video.VideoUrl)) { result.Add(video); } } else // Sendung hat einzelne Beiträge { //video.ImageUrl = category.Thumb; foreach (var sub_li in sub_lis) { var subVideo = new DetailVideoInfo() { Title = video.Title }; FillVideoInfoFromLI(sub_li, subVideo, false); subVideo.Length = subVideo.Length.Replace("min", "").Trim(); if (!string.IsNullOrEmpty(subVideo.VideoUrl)) { video.Children.Add(subVideo); } } if (video.Children.Count > 0) { result.Add(video); } } } } } var nextPageLink = html.DocumentNode.Descendants("a").Where(a => a.InnerText == "Weiter").FirstOrDefault(); if (nextPageLink != null) { HasNextPage = true; nextPageUrl = "http://mediathek.rbb-online.de" + nextPageLink.GetAttributeValue("href", ""); } return(result); }
public List<DetailVideoInfo> GetVideoChoices(VideoInfo video) { List<DetailVideoInfo> clips = new List<DetailVideoInfo>(); // make the movie request Movie movie = video.Other as Movie; if (movie == null) { movie = apiSession.Get<Movie>(video.VideoUrl); video.Other = movie; } NodeResult result = movie.Update(); if (movie.State == NodeState.Complete) { // complete movie metadata video.Description = movie.Plot; video.Length = movie.ReleaseDate != DateTime.MinValue ? movie.ReleaseDate.ToShortDateString() : "Coming Soon"; video.Thumb = movie.Poster != null ? movie.Poster.Large : string.Empty; video.VideoUrl = movie.Uri; } // get initial video list foreach (Video clip in movie.Videos) { DetailVideoInfo vid = new DetailVideoInfo(); vid.Other = clip; vid.Title = movie.Title + " - " + clip.Title; vid.Title2 = clip.Title; vid.Description = movie.Plot; //vid.Length = clip.Duration.ToString(); vid.Length = clip.Published != DateTime.MinValue ? clip.Published.ToShortDateString() : "N/A"; vid.Thumb = !string.IsNullOrEmpty(clip.ThumbUrl) ? clip.ThumbUrl : (movie.Poster != null ? movie.Poster.Uri : string.Empty); //vid.ThumbnailImage = video.ThumbnailImage; vid.VideoUrl = clip.Uri; clips.Add(vid); } return clips; }