/// <summary> /// Gets the actual rtmp url for a given video /// </summary> /// <param name="video">The video that is started</param> /// <returns>The actual playback url</returns> public override string GetVideoUrl(VideoInfo video) { Log.Info("Get url: " + video.VideoUrl); LaolaCategoryTypes type = (LaolaCategoryTypes)video.Other; if (type == LaolaCategoryTypes.Archive) { return(getVideoArchiveUrl(video)); } else if (type == LaolaCategoryTypes.Live) { return(getVideoLiveUrl(video)); } return(null); }
public override string GetFileNameForDownload(VideoInfo video, Category category, string url) { Log.Info("Get download name for : " + video.VideoUrl); LaolaCategoryTypes type = (LaolaCategoryTypes)video.Other; if (type == LaolaCategoryTypes.Archive) { String title = video.Title + ".flv"; return(Helpers.FileUtils.GetSaveFilename(title)); } else if (type == LaolaCategoryTypes.Live) { String title = "LIVE - " + video.Title + ".flv"; return(Helpers.FileUtils.GetSaveFilename(title)); } return(null); }
/// <summary> /// Gets the list of videos for the given category /// </summary> /// <param name="category">The parent category</param> /// <returns>List of video items</returns> public override List <VideoInfo> GetVideos(Category category) { currentCategory = category; List <VideoInfo> videos = new List <VideoInfo>(); LaolaCategoryTypes type = (LaolaCategoryTypes)category.Other; if (type == LaolaCategoryTypes.Archive) { String data = GetWebData((category as RssLink).Url); Match videoMatches = regEx_VideosArchive.Match(data); while (videoMatches.Success) { String categoryUrl = videoMatches.Groups["url"].Value; String categoryTitle = videoMatches.Groups["title"].Value; String categoryDate = videoMatches.Groups["date"].Value; String categoryImage = videoMatches.Groups["img"].Value; VideoInfo video = new VideoInfo(); video.Title = categoryTitle; video.VideoUrl = categoryUrl; video.Thumb = categoryImage; video.Airdate = categoryDate; video.Other = LaolaCategoryTypes.Archive; videos.Add(video); videoMatches = videoMatches.NextMatch(); } Match nextMatch = regEx_VideosNextPage.Match(data); if (nextMatch.Success) { nextVideoPage = nextMatch.Groups["url"].Value; } else { nextVideoPage = null; } } else if (type == LaolaCategoryTypes.Live) { String data = GetWebData((category as RssLink).Url); Match liveMatches = regEx_VideosLive.Match(data); while (liveMatches.Success) { String categoryUrl = liveMatches.Groups["url"].Value; String categoryTitle = liveMatches.Groups["title"].Value; String categoryDate = liveMatches.Groups["date"].Value; String categoryImage = liveMatches.Groups["img"].Value; VideoInfo video = new VideoInfo(); video.Title = categoryTitle; video.VideoUrl = categoryUrl; video.Thumb = categoryImage; video.Airdate = categoryDate; video.Other = LaolaCategoryTypes.Live; videos.Add(video); liveMatches = liveMatches.NextMatch(); } } return(videos); }