public void CreateVideoFromImages(List<string> imagePaths, AudioUoW audio, string outputPath, VideoQuality vq, List<VideoRenderedEventHandler> renderCompleted = null) { try { using (ITimeline timeline = new DefaultTimeline()) { var profile = SplicerWMVProfile.GetProfile(vq); var group = timeline.AddVideoGroup(32, profile.Width, profile.Height); var videoTrack = group.AddTrack(); var audioTrack = timeline.AddAudioGroup().AddTrack(); var a = audioTrack.AddAudio(audio.AudioPath); var imageDuration = a.Duration/imagePaths.Count; foreach (var imagePath in imagePaths) { videoTrack.AddImage(imagePath, InsertPosition.Relative, 0, 0, imageDuration); } IRenderer renderer = new WindowsMediaRenderer(timeline, outputPath, profile.Profile); renderer.BeginRender(RenderingCompleted, new VideoRenderedAsyncState() { Renderer = renderer, Audio = audio, RenderCompleted = renderCompleted }); } } catch (Exception ex) { Log.Error(ex.Message, ex); if (renderCompleted != null) { foreach (var rc in renderCompleted) rc(ex, new VideoRenderedEventArgs()); } } }
public DownloadSettings(string saveForamt, bool audioOnly, VideoQuality quality, bool preferHighestFPS, bool preferQuality, bool convert, bool setBitrate, string bitrate, bool downloadCaptions, string captionsLanguage, bool savePlaylistsInDifferentDirectories, bool subset, int subsetStartIndex, int subsetEndIndex, bool openDestinationFolderWhenDone, bool tagAudioFile, bool filterVideosByLength, bool filterMode, double filterByLengthValue) { SaveFormat = saveForamt; AudioOnly = audioOnly; Quality = quality; PreferHighestFPS = preferHighestFPS; PreferQuality = preferQuality; Convert = convert; Bitrate = bitrate; SetBitrate = setBitrate; DownloadCaptions = downloadCaptions; CaptionsLanguage = captionsLanguage; SavePlaylistsInDifferentDirectories = savePlaylistsInDifferentDirectories; Subset = subset; SubsetStartIndex = subsetStartIndex; SubsetEndIndex = subsetEndIndex; OpenDestinationFolderWhenDone = openDestinationFolderWhenDone; TagAudioFile = tagAudioFile; FilterVideosByLength = filterVideosByLength; FilterMode = filterMode; FilterByLengthValue = filterByLengthValue; }
public static string Format(VideoQuality quality) { string qualityString; switch (quality) { case VideoQuality.Best: qualityString = "bestvideo[vcodec*=avc1]"; break; case VideoQuality.High: qualityString = "bestvideo[height<=1080][vcodec*=avc1]"; break; case VideoQuality.Medium: qualityString = "bestvideo[height<=720][vcodec*=avc1]"; break; case VideoQuality.Low: qualityString = "bestvideo[height<=480][vcodec*=avc1]"; break; default: qualityString = "bestvideo[height<=480][vcodec*=avc1]"; break; } if (YouTubeDownloader.hasFFMPEG) { qualityString += "+bestaudio[acodec*=mp4]"; } return(qualityString); }
/// <summary /> public MuxedStreamInfo(int itag, string url, long size) : base(itag, url, size) { AudioEncoding = GetAudioEncoding(itag); VideoEncoding = GetVideoEncoding(itag); VideoQuality = GetVideoQuality(itag); VideoQualityLabel = VideoQuality.GetVideoQualityLabel(); }
/// <summary> /// Updates the <see cref="BaseUbiIniGameConfigViewModel{Handler}.ConfigData"/> /// </summary> /// <returns>The task</returns> protected override Task UpdateConfigAsync() { ConfigData.GLI_Mode = new RayGLI_Mode() { ColorMode = IsTextures32Bit ? 32 : 16, IsWindowed = !FullscreenMode, ResX = ResX, ResY = ResY }.ToString(); ConfigData.FormattedTriLinear = TriLinear; ConfigData.FormattedTnL = TnL; ConfigData.FormattedTexturesCompressed = CompressedTextures; ConfigData.Video_WantedQuality = VideoQuality.ToString(); ConfigData.FormattedVideo_AutoAdjustQuality = AutoVideoQuality; ConfigData.Video_BPP = IsVideo32Bpp ? "32" : "16"; ConfigData.Language = CurrentLanguage.ToString(); ConfigData.FormattedDynamicShadows = DynamicShadows; ConfigData.FormattedStaticShadows = StaticShadows; ConfigData.Camera_VerticalAxis = VerticalAxis.ToString(); ConfigData.Camera_HorizontalAxis = HorizontalAxis.ToString(); ConfigData.TexturesFile = $"Tex{(IsTextures32Bit ? 32 : 16)}.cnt"; return(Task.CompletedTask); }
public static string Format(VideoQuality quality) { String qualityString; switch (quality) { case VideoQuality.Best: qualityString = "bestvideo[vcodec*=avc1]"; break; case VideoQuality.High: qualityString = "bestvideo[height<=1080][vcodec*=avc1]"; break; case VideoQuality.Medium: qualityString = "bestvideo[height<=720][vcodec*=avc1]"; break; case VideoQuality.Low: qualityString = "bestvideo[height<=480][vcodec*=avc1]"; break; default: qualityString = "bestvideo[height<=480][vcodec*=avc1]"; break; } return(qualityString); }
public void Extensions_VideoQuality_GetVideoQualityLabel_Test(VideoQuality quality, [Values(24, 30, 60)] int framerate) { var label = quality.GetVideoQualityLabel(framerate); Assert.That(label, Is.Not.Null.Or.Empty); }
public Task<IEnumerable<ITorrentSearchResult>> SearchTvShowEpisode(string name, int season, int episode, string episodeName, string imdbId = null, VideoQuality videoQuality = VideoQuality.Any, string extraKeywords = null, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null, ITorrentDownloader service = null) { var query = Settings.TvShowEpisodeSearchPattern; query = Helper.PopulateTvShowEpisodeSearchQuery(query, name, season, episode, imdbId, extraKeywords); return Search(query, videoQuality, excludeKeywords, minSize, maxSize, minSeed, service); }
public void CreateVideoFromImages(List<string> imagePaths, AudioUoW audio, string outputPath, VideoQuality vq, List<VideoRenderedEventHandler> renderCompleted = null) { try { var vew = new VideoEncoderWrapper(); vew.EncodingCompleted += (sender, args) => { EncodingCompleted(this, EventArgs.Empty); if (renderCompleted != null) { foreach (var rc in renderCompleted) { rc(this, new VideoRenderedEventArgs() { Audio = audio }); } } }; vew.EncodeAsync(imagePaths[0], audio.AudioPath, outputPath); } catch (Exception ex) { Log.Error(ex.Message, ex); throw; } }
private static int GetResolution(VideoQuality quality) { switch (quality) { case VideoQuality.Unknown: return(-1); case VideoQuality.Quality144P: return(144); case VideoQuality.Quality240P: return(240); case VideoQuality.Quality270P: return(270); case VideoQuality.Quality360P: return(360); case VideoQuality.Quality480P: return(480); case VideoQuality.Quality720P: return(720); case VideoQuality.Quality1080P: return(1080); default: return(-1); } }
/// <summary> /// Initializes an instance of <see cref="MuxedStreamInfo"/>. /// </summary> public MuxedStreamInfo( int tag, string url, Container container, FileSize size, Bitrate bitrate, string audioCodec, string videoCodec, string videoQualityLabel, VideoQuality videoQuality, VideoResolution resolution, Framerate framerate) { Tag = tag; Url = url; Container = container; Size = size; Bitrate = bitrate; AudioCodec = audioCodec; VideoCodec = videoCodec; VideoQualityLabel = videoQualityLabel; VideoQuality = videoQuality; Resolution = resolution; Framerate = framerate; }
public void Start() { #if UNITY_WEBGL useNewVersion = true; #endif resolver = gameObject.AddComponent <RequestResolver>(); if (Application.isMobilePlatform) { if (GetMaxQualitySupportedByDevice() <= 720) { //low end device.. if (videoQuality != VideoQuality.mediumQuality) { videoQuality = VideoQuality.Hd720; } noHD = true; } } if (playOnStart) { PlayYoutubeVideo(videoId); } }
public static VideoQuality SetVideoQuality(int height = 2) { VideoQuality quality = VideoQuality.High1080; switch (height) { case 0: quality = VideoQuality.High2160; break; case 1: quality = VideoQuality.High1440; break; case 2: quality = VideoQuality.High1080; break; case 3: quality = VideoQuality.High720; break; case 4: quality = VideoQuality.Medium480; break; case 5: quality = VideoQuality.Medium360; break; } return(quality); }
public void Start() { if (videoQuality == VideoQuality.Hd720) { noHD = true; } #if UNITY_WEBGL useNewVersion = true; #endif unityVideoPlayer.started += VideoStarted; unityVideoPlayer.errorReceived += VideoErrorReceived; unityVideoPlayer.frameDropped += VideoFrameDropped; unityVideoPlayer.sendFrameReadyEvents = true; unityVideoPlayer.frameReady += VideoFrameReady; resolver = gameObject.AddComponent <RequestResolver>(); if (Application.isMobilePlatform) { if (GetMaxQualitySupportedByDevice() <= 720) { //low end device.. if (videoQuality != VideoQuality.mediumQuality) { videoQuality = VideoQuality.Hd720; } noHD = true; } } if (playOnStart) { PlayYoutubeVideo(videoId); } }
public VideoQuality GetPreferredVideoQuality() { try { if (!_hasCheckedForPreviousPreference) { var setting = _settingsManager.GetSetting(VideoQualitySettingName); if (setting == null) { SetNewQualityPreference(VideoQuality.HD); } else { Enum.TryParse((string)setting, out _currentQualityPreference); } _hasCheckedForPreviousPreference = true; } } catch (Exception e) { Serilog.Log.Error(e, "Error getting preferred video quality"); _currentQualityPreference = VideoQuality.HD; } return(_currentQualityPreference); }
public void UpdateVideo(VideoClip video, VideoType vidType, VideoQuality vidQuality) { curClip = video; curQuality = vidQuality; curType = vidType; switch (curType) { case VideoType.ThreeSixty: RenderSettings.skybox = type[0]; break; case VideoType.ThreeDOverUnder: RenderSettings.skybox = type[1]; break; case VideoType.ThreeDSideBySide: RenderSettings.skybox = type[2]; break; default: RenderSettings.skybox = type[0]; break; } player.clip = curClip; }
/// <summary> /// Initializes a video stream of optimal settings. /// </summary> /// <param name="xbox"></param> public XboxVideoStream(Xbox xbox) { Xbox = xbox; this.size = VideoSize.Medium; Quality = VideoQuality.Regular; Interval = VideoPresentationInterval.Two; }
static public string GetVideoQuality(VideoQuality quality, bool GetMuxed) { if (GetMuxed) { foreach (var video in Constants.videoInfo.Muxed) { if (video.VideoQuality == quality) { return(video.Url); } } } else { foreach (var video in Constants.videoInfo.Video) { if (video.VideoQuality == quality) { return(video.Url); } } } return(null); }
/// <summary> /// Gets label for given video quality , as displayed on YouTube. /// </summary> public static string GetVideoQualityLabel(this VideoQuality videoQuality) { if (videoQuality == VideoQuality.Low144) { return("144p"); } if (videoQuality == VideoQuality.Low240) { return("240p"); } if (videoQuality == VideoQuality.Medium360) { return("360p"); } if (videoQuality == VideoQuality.Medium480) { return("480p"); } if (videoQuality == VideoQuality.High720) { return("720p"); } if (videoQuality == VideoQuality.High1080) { return("1080p"); } if (videoQuality == VideoQuality.High1440) { return("1440p"); } if (videoQuality == VideoQuality.High2160) { return("2160p"); } if (videoQuality == VideoQuality.High2880) { return("2880p"); } if (videoQuality == VideoQuality.High3072) { return("3072p"); } if (videoQuality == VideoQuality.High4320) { return("4320p"); } throw new ArgumentOutOfRangeException(nameof(videoQuality), $"Unexpected video quality [{videoQuality}]."); }
public VideoStreamInfo(string streamUrl, VideoQuality quality, string qualityLabel, int height, int width) { StreamUrl = streamUrl; Quality = quality; QualityLabel = qualityLabel; Height = height; Width = width; }
public override string GetVideoUrl(VideoInfo video) { string result = String.Empty; int p = video.VideoUrl.LastIndexOf('/'); if (p >= 0) { string id = video.VideoUrl.Substring(p + 1); string newToken = Doskabouter.Helpers.NPOHelper.GetToken(video.VideoUrl, GetProxy()); if (!String.IsNullOrEmpty(newToken)) { string webData = GetWebData(String.Format(fileUrlFormatString, id) + newToken, proxy: GetProxy()); JObject contentData = (JObject)JObject.Parse(webData); JArray items = contentData["items"][0] as JArray; List <KeyValuePair <string, string> > playbackOptions = new List <KeyValuePair <string, string> >(); foreach (JToken item in items) { string s = item.Value <string>("url"); Match m = Regex.Match(s, @"/ida/(?<quality>[^/]*)/"); if (!m.Success) { m = Regex.Match(s, @"(?<quality>\d+x\d+)_"); } if (m.Success) { string quality = m.Groups["quality"].Value; try { VideoQuality vq = (VideoQuality)Enum.Parse(typeof(VideoQuality), quality, true); if (Enum.IsDefined(typeof(VideoQuality), vq) && vq.Equals(preferredQuality)) { result = s; } } catch (ArgumentException) { }; playbackOptions.Add(new KeyValuePair <string, string>(quality, s)); } } playbackOptions.Sort(Compare); video.PlaybackOptions = new Dictionary <string, string>(); foreach (KeyValuePair <string, string> kv in playbackOptions) { video.PlaybackOptions.Add(kv.Key, kv.Value); } } if (String.IsNullOrEmpty(result)) { result = video.PlaybackOptions.Last().Value; } } return(result); }
/// <summary> /// Gets label for given video quality and framerate, as displayed on YouTube. /// </summary> public static string GetVideoQualityLabel(this VideoQuality videoQuality, int framerate = 30) { // Video quality string qualityPart; switch (videoQuality) { case VideoQuality.Low144: qualityPart = "144p"; break; case VideoQuality.Low240: qualityPart = "240p"; break; case VideoQuality.Medium360: qualityPart = "360p"; break; case VideoQuality.Medium480: qualityPart = "480p"; break; case VideoQuality.High720: qualityPart = "720p"; break; case VideoQuality.High1080: qualityPart = "1080p"; break; case VideoQuality.High1440: qualityPart = "1440p"; break; case VideoQuality.High2160: qualityPart = "2160p"; break; case VideoQuality.High3072: qualityPart = "3072p"; break; case VideoQuality.High4320: qualityPart = "4320p"; break; default: throw new ArgumentOutOfRangeException(nameof(videoQuality), $"Unexpected video quality [{videoQuality}]."); } // Append framerate if it's above 30 // (YouTube's framerate part is always 60, no matter what it actually is) var frameratePart = framerate > 30 ? "60" : string.Empty; return(qualityPart + frameratePart); }
private static bool IsAvailableVideo(YouTubeVideo video, VideoQuality minQuality, VideoQuality maxQuality) { return(video.AudioFormat != AudioFormat.Unknown && video.Resolution != -1 && !video.Is3D && (video.Format == VideoFormat.Mp4 || video.Format == VideoFormat.Mobile) && video.Resolution >= GetResolution(minQuality) && video.Resolution <= GetResolution(maxQuality)); }
public Task <IEnumerable <ITorrentSearchResult> > SearchTvShowEpisode(string name, int season, int episode, string episodeName, string imdbId = null, VideoQuality videoQuality = VideoQuality.Any, string extraKeywords = null, string excludeKeywords = null, int?minSize = null, int?maxSize = null, int?minSeed = null, ITorrentDownloader service = null) { var query = Settings.TvShowEpisodeSearchPattern; query = Helper.PopulateTvShowEpisodeSearchQuery(query, name, season, episode, imdbId, extraKeywords); return(Search(query, videoQuality, excludeKeywords, minSize, maxSize, minSeed, service)); }
public Task InitSearch(string searchQuery, VideoQuality videoQuality, string excludeKeywords, int? minSize, int? maxSize) { SearchQuery = searchQuery; VideoQuality = videoQuality; ExcludeKeywords = excludeKeywords; MinSize = minSize; MaxSize = maxSize; return Search(); }
public override string GetVideoUrl(VideoInfo video) { string result = String.Empty; int p = video.VideoUrl.LastIndexOf('/'); if (p >= 0) { string id = video.VideoUrl.Substring(p + 1); string webData = GetWebData(@"http://ida.omroep.nl/npoplayer/i.js"); Match m = Regex.Match(webData, @"token\s*=\s*""(?<token>[^""]*)""", defaultRegexOptions); if (m.Success) { webData = GetWebData(String.Format(fileUrlFormatString, id) + m.Groups["token"].Value); JObject contentData = (JObject)JObject.Parse(webData); JArray items = contentData["streams"] as JArray; List <KeyValuePair <string, string> > playbackOptions = new List <KeyValuePair <string, string> >(); foreach (JToken item in items) { string s = item.Value <string>(); m = Regex.Match(s, @"/ida/(?<quality>[^/]*)/"); if (m.Success) { string quality = m.Groups["quality"].Value; try { VideoQuality vq = (VideoQuality)Enum.Parse(typeof(VideoQuality), quality, true); if (Enum.IsDefined(typeof(VideoQuality), vq) && vq.Equals(preferredQuality)) { result = s; } } catch (ArgumentException) { }; playbackOptions.Add(new KeyValuePair <string, string>(quality, s)); } } playbackOptions.Sort(Compare); video.PlaybackOptions = new Dictionary <string, string>(); foreach (KeyValuePair <string, string> kv in playbackOptions) { video.PlaybackOptions.Add(kv.Key, kv.Value); } } if (String.IsNullOrEmpty(result)) { result = video.PlaybackOptions.Last().Value; } } return(result); }
/// <summary> /// Gets label for given video quality and framerate, as displayed on YouTube. /// </summary> public static string GetVideoQualityLabel(this VideoQuality videoQuality, int framerate = 30) { // Video quality string qualityPart; switch (videoQuality) { case VideoQuality.Low144: qualityPart = "144p"; break; case VideoQuality.Low240: qualityPart = "240p"; break; case VideoQuality.Medium360: qualityPart = "360p"; break; case VideoQuality.Medium480: qualityPart = "480p"; break; case VideoQuality.High720: qualityPart = "720p"; break; case VideoQuality.High1080: qualityPart = "1080p"; break; case VideoQuality.High1440: qualityPart = "1440p"; break; case VideoQuality.High2160: qualityPart = "2160p"; break; case VideoQuality.High3072: qualityPart = "3072p"; break; case VideoQuality.High4320: qualityPart = "4320p"; break; default: throw new ArgumentOutOfRangeException(nameof(videoQuality), $"Unexpected video quality [{videoQuality}]."); } // Framerate var frameratePart = framerate > 30 ? framerate.ToString() : string.Empty; return(qualityPart + frameratePart); }
public async Task <VideoStreamUrlModel> GetVideoStreamUrl(Int32 videoId, VideoQuality videoQuality) { return(HandleResponse(await RestClient.Process <VideoStreamUrlModel>( RestUtility.FormatUrl("/videos/{id}/streamurl", new { id = videoId }), new { videoQuality = videoQuality, sessionId = SessionId, countryCode = CountryCode }, null, "GET"))); }
private void SetVideoQuality(string desiredVideoQuality) { if (Enum.TryParse(desiredVideoQuality, true, out VideoQuality existingVideoQuality)) { videoQuality = existingVideoQuality; return; } videoQuality = defaultVideoQuality; }
public HlsPlaylistSegmentManagerPolicy(Func <HlsProgramManager> programManagerFactory, VideoQuality quality) { if (null == programManagerFactory) { throw new ArgumentNullException(nameof(programManagerFactory)); } _programManagerFactory = programManagerFactory; _quality = quality; }
public Task InitSearch(string searchQuery, VideoQuality videoQuality, string excludeKeywords, int?minSize, int?maxSize) { SearchQuery = searchQuery; VideoQuality = videoQuality; ExcludeKeywords = excludeKeywords; MinSize = minSize; MaxSize = maxSize; return(Search()); }
private Settings() { config = new Config("MVP"); placementMode = VideoPlacementSetting.FromName( config.GetString("Positions", "Video Placement", "") ); qualityMode = VideoQualitySetting.FromName( config.GetString("Modes", "Video Quality", "") ); }
/// <summary> /// Used to filter by a given quality. /// </summary> /// <param name="quality">The quality.</param> /// <returns></returns> public ListMoviesRequest Quality(VideoQuality quality) { var suffix = "p"; if (quality == VideoQuality.Q3D) { suffix = ""; } return(this.Query("quality", quality.ToString().Replace("Q", "") + suffix)); }
private VideoModels(int formatCode, VideoQuality videoQuality, int resolution, bool is3D, AudioModel audioModel, int audioBitrate, Type Type) { this.FormatCode = formatCode; this.VideoQuality = videoQuality; this.Resolution = resolution; this.Is3D = is3D; this.AudioModel = audioModel; this.AudioBit = audioBitrate; this.Type = Type; }
/// <summary /> public VideoStreamInfo(int itag, string url, long size, long bitrate, VideoResolution resolution, int framerate) : base(itag, url, size) { Bitrate = bitrate.EnsureNotNegative(nameof(bitrate)); VideoEncoding = GetVideoEncoding(itag); VideoQuality = GetVideoQuality(itag); Resolution = resolution; Framerate = framerate.EnsureNotNegative(nameof(framerate)); VideoQualityLabel = VideoQuality.GetVideoQualityLabel(framerate); }
public void CreateVideoFromImages(List<string> imagePaths, string audioPath, string outputPath, VideoQuality vq, List<VideoRenderedEventHandler> renderCompleted = null) { try { CreateVideoFromImages(imagePaths, new AudioUoW() {AudioPath = audioPath}, outputPath, vq, renderCompleted); } catch (Exception ex) { Log.Error(ex.Message, ex); } }
public Task<IEnumerable<ITorrentSearchResult>> SearchMovie(string name, int? year = null, string imdbId = null, VideoQuality videoQuality = VideoQuality.Any, string extraKeywords = null, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null, ITorrentDownloader service = null) { var query = Settings.MovieSearchPattern; if (!string.IsNullOrEmpty(imdbId)) imdbId = imdbId.Replace("tt", ""); query = Helper.PopulateMovieSearchQuery(query, name, year, imdbId, extraKeywords); query += " category:movies"; return Search(query, videoQuality, excludeKeywords, minSize, maxSize, minSeed, service); }
public IEnumerable<DownloadQueueItem> GetQueue(VideoQuality quality) { var patternsToDownload = quality.Pattern.Union(new[] { ".pptx" }); var service = new PDC.ScheduleModel(new Uri("http://odata.microsoftpdc.com/ODataSchedule.svc")); var items = service.Sessions.Expand("DownloadableContent").ToList() .SelectMany(s => s.DownloadableContent .Select(i => new DownloadQueueItem() { Name = s.FullTitle, Url = i.Url })) .Where( q => patternsToDownload.Any(ext => q.Url.EndsWith(ext, StringComparison.OrdinalIgnoreCase))); return items; }
public void CreateVideoFromImages(List<string> imagePaths, AudioUoW audio, string outputPath, VideoQuality vq, List<VideoRenderedEventHandler> renderCompleted = null) { try { //_ve.SetImageFilePath(imagePaths[0]); //_ve.SetAudioFilePath(GetCorrectFilename(audio.AudioPath)); //_ve.SetVideoOutputPath(outputPath); //_ve.Encode(); } catch (Exception ex) { Log.Error(ex.Message, ex); } }
public override Task<IEnumerable<ITorrentSearchResult>> SearchMovie(string name, int? year, string imdbId, VideoQuality videoQuality = VideoQuality.Any, string extraKeywords = null, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null) { if (videoQuality == VideoQuality.Any) videoQuality = Settings.DefaultMovieVideoQuality.SelectedItem.Item; if (string.IsNullOrEmpty(extraKeywords)) extraKeywords = Settings.DefaultMovieExtraKeywords; if (string.IsNullOrEmpty(excludeKeywords)) excludeKeywords = Settings.DefaultMovieExcludeKeywords; if (minSize == null) minSize = Settings.DefaultMinSize; if (maxSize == null) maxSize = Settings.DefaultMaxSize; if (minSeed == null) minSeed = Settings.DefaultMinSeed; return base.SearchMovie(name, year, imdbId, videoQuality, extraKeywords, excludeKeywords, minSize, maxSize, minSeed); }
public IEnumerable<DownloadQueueItem> GetQueue(VideoQuality quality) { var q = (Mix11VideoQuality) quality.Key; var service = new Mix11.eventsEntities(new Uri(@"http://live.visitmix.com/odata")); var items = service.Sessions.ToList(); var vidQueue = items.Select( s => new DownloadQueueItem() {Name = s.SessionCode, Url = String.Format(q.UrlFormat, s.SessionCode)}). ToList(); var pptQueue = service.Sessions.ToList().Select( s => new DownloadQueueItem() { Name = s.SessionCode, Url = String.Format("http://files.ch9.ms/mix/2011/ppt/{0}.pptx", s.SessionCode) }).ToList(); return vidQueue.Union(pptQueue); }
public void CreateVideoFromImages(List<string> imagePaths, string audioPath, string outputPath, VideoQuality vq, List<VideoRenderedEventHandler> renderCompleted = null) { try { //_ve.ImageFilePath = imagePaths[0]; ////_ve.AudioFilePath = GetCorrectFilename(audioPath); ////_ve.VideoOutputPath = outputPath; System.Diagnostics.Debug.WriteLine("Testttt"); var t = _ve.ImageFilePath; System.Diagnostics.Debug.WriteLine(t); //_ve.Encode(); var s = "s"; } catch (Exception ex) { Log.Error(ex.Message, ex); } }
public void LoadFromFile(String file) { IniParser parser = new IniParser(file); String res = parser.GetSetting("Video", "Water").ToLower(); switch (res) { case "verylow": Water = VideoQuality.LOW; break; case "low": Water = VideoQuality.LOW; break; case "medium": Water = VideoQuality.MEDIUM; break; case "high": Water = VideoQuality.HIGH; break; case "ultra": Water = VideoQuality.ULTRA; break; } }
public async Task<IEnumerable<ITorrentSearchResult>> SearchMovie(string name, int? year = null, string imdbId = null, VideoQuality videoQuality = VideoQuality.Any, string extraKeywords = null, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null, ITorrentDownloader service = null) { var query = Settings.MovieSearchPattern; IEnumerable<ITorrentSearchResult> results; if (query == ThePirateBaySettings.ImdbSearchQuery) results = await Search(imdbId, VideoQuality.Any, excludeKeywords, minSize, maxSize, minSeed, service); else { query = Helper.PopulateMovieSearchQuery(query, name, year, imdbId, extraKeywords); results = await Search(query, videoQuality, excludeKeywords, minSize, maxSize, minSeed, service); } if (query == ThePirateBaySettings.ImdbSearchQuery) { string filter; switch (videoQuality) { case VideoQuality.P720: filter = "720p"; break; case VideoQuality.P1080: filter = "1080p"; break; default: filter = string.Empty; break; } if (extraKeywords != null) filter += " " + extraKeywords; if (filter != string.Empty) { var filters = filter.Split(' '); results = results.Where(r => filters.All(e => r.Name.Contains(e))); } } return results; }
/// <summary> /// Gets the video quality. /// </summary> /// <param name="videoQuality">The video quality.</param> /// <returns>System.Int32.</returns> private static int GetVideoQuality(VideoQuality videoQuality) { switch (videoQuality) { case VideoQuality.Medium: case VideoQuality.High: return 1; default: return 0; } }
/// <summary> /// Called when the activity is starting. /// </summary> /// <param name="savedInstanceState">If the activity is being re-initialized after /// previously being shut down then this Bundle contains the data it most /// recently supplied in <c><see cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /></c>. <format type="text/html"><b><i>Note: Otherwise it is null.</i></b></format></param> /// <since version="Added in API level 1" /> /// <altmember cref="M:Android.App.Activity.OnStart" /> /// <altmember cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /> /// <altmember cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /> /// <altmember cref="M:Android.App.Activity.OnPostCreate(Android.OS.Bundle)" /> /// <remarks><para tool="javadoc-to-mdoc">Called when the activity is starting. This is where most initialization /// should go: calling <c><see cref="M:Android.App.Activity.SetContentView(System.Int32)" /></c> to inflate the /// activity's UI, using <c><see cref="M:Android.App.Activity.FindViewById(System.Int32)" /></c> to programmatically interact /// with widgets in the UI, calling /// <c><see cref="M:Android.App.Activity.ManagedQuery(Android.Net.Uri, System.String[], System.String[], System.String[], System.String[])" /></c> to retrieve /// cursors for data being displayed, etc. /// </para> /// <para tool="javadoc-to-mdoc">You can call <c><see cref="M:Android.App.Activity.Finish" /></c> from within this function, in /// which case onDestroy() will be immediately called without any of the rest /// of the activity lifecycle (<c><see cref="M:Android.App.Activity.OnStart" /></c>, <c><see cref="M:Android.App.Activity.OnResume" /></c>, /// <c><see cref="M:Android.App.Activity.OnPause" /></c>, etc) executing. /// </para> /// <para tool="javadoc-to-mdoc"> /// <i>Derived classes must call through to the super class's /// implementation of this method. If they do not, an exception will be /// thrown.</i> /// </para> /// <para tool="javadoc-to-mdoc"> /// <format type="text/html"> /// <a href="http://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)" target="_blank">[Android Documentation]</a> /// </format> /// </para></remarks> protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var b = (savedInstanceState ?? Intent.Extras); var ran = b.GetBoolean("ran", false); _title = b.GetString(MediaStore.MediaColumns.Title); _description = b.GetString(MediaStore.Images.ImageColumns.Description); _tasked = b.GetBoolean(ExtraTasked); _id = b.GetInt(ExtraId, 0); _type = b.GetString(ExtraType); if (_type == "image/*") { _isPhoto = true; } _action = b.GetString(ExtraAction); Intent pickIntent = null; try { pickIntent = new Intent(_action); if (_action == Intent.ActionPick) pickIntent.SetType(_type); else { if (!_isPhoto) { _seconds = b.GetInt(MediaStore.ExtraDurationLimit, 0); if (_seconds != 0) { pickIntent.PutExtra(MediaStore.ExtraDurationLimit, _seconds); } } _quality = (VideoQuality) b.GetInt(MediaStore.ExtraVideoQuality, (int) VideoQuality.High); pickIntent.PutExtra(MediaStore.ExtraVideoQuality, GetVideoQuality(_quality)); if (!ran) { _path = GetOutputMediaFile(this, b.GetString(ExtraPath), _title, _isPhoto); Touch(); pickIntent.PutExtra(MediaStore.ExtraOutput, _path); } else _path = Uri.Parse(b.GetString(ExtraPath)); } if (!ran) { if (global::Android.OS.Build.VERSION.Release == "6.0") { if (CheckSelfPermission(Manifest.Permission.Camera) != Android.Content.PM.Permission.Granted) { RequestPermissions(new string[] { Manifest.Permission.Camera }, 1); } } StartActivityForResult(pickIntent, _id); } } catch (Exception ex) { RaiseOnMediaPicked(new MediaPickedEventArgs(_id, ex)); } finally { if (pickIntent != null) pickIntent.Dispose(); } }
private CameraCaptureUIMaxVideoResolution GetResolutionFromQuality(VideoQuality quality) { switch (quality) { case VideoQuality.High: return CameraCaptureUIMaxVideoResolution.HighestAvailable; case VideoQuality.Medium: return CameraCaptureUIMaxVideoResolution.StandardDefinition; case VideoQuality.Low: return CameraCaptureUIMaxVideoResolution.LowDefinition; default: return CameraCaptureUIMaxVideoResolution.HighestAvailable; } }
private static UIImagePickerControllerQualityType GetQuailty (VideoQuality quality) { switch (quality) { case VideoQuality.Low: return UIImagePickerControllerQualityType.Low; case VideoQuality.Medium: return UIImagePickerControllerQualityType.Medium; default: return UIImagePickerControllerQualityType.High; } }
public void CreateVideoFromImages(List<string> imagePaths, string audioPath, string outputPath, VideoQuality vq, List<VideoRenderedEventHandler> renderCompleted = null) { throw new NotImplementedException(); }
/// <summary> /// Called when the activity is starting. /// </summary> /// <param name="savedInstanceState">If the activity is being re-initialized after /// previously being shut down then this Bundle contains the data it most /// recently supplied in <c><see cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /></c>. <format type="text/html"><b><i>Note: Otherwise it is null.</i></b></format></param> /// <since version="Added in API level 1" /> /// <altmember cref="M:Android.App.Activity.OnStart" /> /// <altmember cref="M:Android.App.Activity.OnSaveInstanceState(Android.OS.Bundle)" /> /// <altmember cref="M:Android.App.Activity.OnRestoreInstanceState(Android.OS.Bundle)" /> /// <altmember cref="M:Android.App.Activity.OnPostCreate(Android.OS.Bundle)" /> /// <remarks><para tool="javadoc-to-mdoc">Called when the activity is starting. This is where most initialization /// should go: calling <c><see cref="M:Android.App.Activity.SetContentView(System.Int32)" /></c> to inflate the /// activity's UI, using <c><see cref="M:Android.App.Activity.FindViewById(System.Int32)" /></c> to programmatically interact /// with widgets in the UI, calling /// <c><see cref="M:Android.App.Activity.ManagedQuery(Android.Net.Uri, System.String[], System.String[], System.String[], System.String[])" /></c> to retrieve /// cursors for data being displayed, etc. /// </para> /// <para tool="javadoc-to-mdoc">You can call <c><see cref="M:Android.App.Activity.Finish" /></c> from within this function, in /// which case onDestroy() will be immediately called without any of the rest /// of the activity lifecycle (<c><see cref="M:Android.App.Activity.OnStart" /></c>, <c><see cref="M:Android.App.Activity.OnResume" /></c>, /// <c><see cref="M:Android.App.Activity.OnPause" /></c>, etc) executing. /// </para> /// <para tool="javadoc-to-mdoc"> /// <i>Derived classes must call through to the super class's /// implementation of this method. If they do not, an exception will be /// thrown.</i> /// </para> /// <para tool="javadoc-to-mdoc"> /// <format type="text/html"> /// <a href="http://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)" target="_blank">[Android Documentation]</a> /// </format> /// </para></remarks> protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var b = (savedInstanceState ?? Intent.Extras); var ran = b.GetBoolean("ran", false); _title = b.GetString(MediaStore.MediaColumns.Title); _description = b.GetString(MediaStore.Images.ImageColumns.Description); _tasked = b.GetBoolean(EXTRA_TASKED); _id = b.GetInt(EXTRA_ID, 0); _type = b.GetString(EXTRA_TYPE); if (_type == "image/*") { _isPhoto = true; } _action = b.GetString(EXTRA_ACTION); Intent pickIntent = null; try { pickIntent = new Intent(_action); if (_action == Intent.ActionPick) pickIntent.SetType(_type); else { if (!_isPhoto) { _seconds = b.GetInt(MediaStore.ExtraDurationLimit, 0); if (_seconds != 0) { pickIntent.PutExtra(MediaStore.ExtraDurationLimit, _seconds); } } _quality = (VideoQuality) b.GetInt(MediaStore.ExtraVideoQuality, (int) VideoQuality.High); pickIntent.PutExtra(MediaStore.ExtraVideoQuality, GetVideoQuality(_quality)); if (!ran) { _path = GetOutputMediaFile(this, b.GetString(EXTRA_PATH), _title, _isPhoto); Touch(); pickIntent.PutExtra(MediaStore.ExtraOutput, _path); } else _path = Uri.Parse(b.GetString(EXTRA_PATH)); } if (!ran) { StartActivityForResult(pickIntent, _id); } } catch (Exception ex) { RaiseOnMediaPicked(new MediaPickedEventArgs(_id, ex)); } finally { if (pickIntent != null) pickIntent.Dispose(); } }
/// <summary> /// Parse all the values that are shared between shows and movies /// </summary> /// <param name="input">Input string</param> /// <param name="dir">Switch whenever it is a directory name.</param> private void ParseShared(String input, Boolean dir = false) { String inputCl = helperDictionary.CleanFileName(input); Int32 TmpStart; String TmpString; #region videoQuality if (videoQuality == VideoQuality.Unknown) { TmpString = Check(inputCl, helperDictionary.VideoQualityStrings, out TmpStart); videoQuality = helperDictionary.StrToVideoQuality(TmpString); if (TmpString.Length > 0) Index.Add(new StringLocation(TmpString, TmpStart, TmpString.Length, true, dir)); } #endregion #region videoSource if (videoSource == VideoSource.Unknown) { TmpString = Check(inputCl, helperDictionary.VideoSourceStrings, out TmpStart); videoSource = helperDictionary.StrToVideoSource(TmpString); if (TmpString.Length > 0) Index.Add(new StringLocation(TmpString, TmpStart, TmpString.Length, true, dir)); } #endregion #region container if (container == Container.Unknown & !dir) { //TmpString = Check(fileExt, helperDictionary.ContainerStrings, out TmpStart); container = helperDictionary.StrToContainer(fileExt); //if (TmpString.Length > 0) //Index.Add(new StringLocation(TmpString, TmpStart, TmpString.Length, true, dir)); } #endregion #region videoCodec if (videoCodec == VideoCodec.Unknown) { TmpString = Check(inputCl, helperDictionary.VideoCodecStrings, out TmpStart); videoCodec = helperDictionary.StrToVideoCodec(TmpString); if (TmpString.Length > 0) Index.Add(new StringLocation(TmpString, TmpStart, TmpString.Length, true, dir)); } #endregion #region audioCodec if (audioCodec == AudioCodec.Unknown) { TmpString = Check(inputCl, helperDictionary.AudioCodecStrings, out TmpStart); audioCodec = helperDictionary.StrToAudioCodec(TmpString); if (TmpString.Length > 0) Index.Add(new StringLocation(TmpString, TmpStart, TmpString.Length, true, dir)); } #endregion #region sample //Check if our file is a sample if (!sample) { TmpStart = inputCl.IndexOf("sample"); if (TmpStart > -1 & (fileSize < 1024 * 1024 * 1024)) { sample = true; Index.Add(new StringLocation("sample", TmpStart, 6, true, dir)); } } #endregion }
public static SplicerWMVProfile GetProfile(VideoQuality vq) { var profile = new SplicerWMVProfile(); switch (vq) { case VideoQuality.FULLHD2_NTSC: profile.Profile = WindowsMediaProfiles.FULLHD2_NTSC; profile.Width = 1920; profile.Height = 1080; break; case VideoQuality.FullHD: profile.Profile = WindowsMediaProfiles.FullHD; profile.Width = 1920; profile.Height = 1080; break; case VideoQuality.HD2_NTSC: profile.Profile = WindowsMediaProfiles.HD2_NTSC; profile.Width = 1280; profile.Height = 720; break; case VideoQuality.HighQuality2_NTSC: profile.Profile = WindowsMediaProfiles.HighQuality2_NTSC; profile.Width = 640; profile.Height = 360; break; case VideoQuality.HighQuality_NTSC: profile.Profile = WindowsMediaProfiles.HighQuality_NTSC; profile.Width = 1440; profile.Height = 1080; break; case VideoQuality.HighQuality_PAL: profile.Profile = WindowsMediaProfiles.HighQuality_PAL; profile.Width = 1440; profile.Height = 1080; break; case VideoQuality.SplicerDefaultHighQualityVideo: profile.Profile = WindowsMediaProfiles.HighQualityVideo; profile.Width = 320; profile.Height = 240; break; case VideoQuality.SplicerDefaultLowQualityAudio: profile.Profile = WindowsMediaProfiles.LowQualityAudio; profile.Width = 0; profile.Height = 0; break; case VideoQuality.SplicerDefaultLowQualityVideo: profile.Profile = WindowsMediaProfiles.LowQualityVideo; profile.Width = 0; profile.Height = 0; break; case VideoQuality.SplicerDefaultMediumQualityAudio: profile.Profile = WindowsMediaProfiles.MediumQualityAudio; profile.Width = 0; profile.Height = 0; break; case VideoQuality.StandardQuality: profile.Profile = WindowsMediaProfiles.StandardQuality; profile.Width = 1280; profile.Height = 720; break; } return profile; }
public override Task<IEnumerable<ITorrentSearchResult>> Search(string query, VideoQuality videoQuality = VideoQuality.Any, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null) { if (videoQuality == VideoQuality.Any) videoQuality = Settings.DefaultTvShowVideoQuality.SelectedItem.Item; if (string.IsNullOrEmpty(excludeKeywords)) excludeKeywords = Settings.DefaultTvShowExcludeKeywords; if (minSize == null) minSize = Settings.DefaultMinSize; if (maxSize == null) maxSize = Settings.DefaultMaxSize; if (minSeed == null) minSeed = Settings.DefaultMinSeed; return base.Search(query, videoQuality, excludeKeywords, minSize, maxSize, minSeed); }
public static MediaInfo GetVideoParams(VideoQuality vq) { switch (vq) { case VideoQuality.p360: return p360; case VideoQuality.p480: return p480; case VideoQuality.p720: return p720; case VideoQuality.p1080: return p1080; } return p360; }
public async Task<IEnumerable<ITorrentSearchResult>> Search(string search, VideoQuality videoQuality = VideoQuality.Any, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null, ITorrentDownloader service = null) { if (videoQuality != VideoQuality.Any) { switch (videoQuality) { case VideoQuality.P720: search += " 720p"; break; case VideoQuality.P1080: search += " 1080p"; break; } } if (!string.IsNullOrEmpty(excludeKeywords)) { excludeKeywords = " " + excludeKeywords; search += excludeKeywords.Replace(" ", " -"); } var url = Helper.CombineUrls(Settings.BaseUrl, "usearch", search); using (var client = new NovaromaWebClient()) { string html; try { html = await client.DownloadStringTaskAsync(url); } catch (WebException ex) { var errorResponse = ex.Response as HttpWebResponse; if (errorResponse != null && errorResponse.StatusCode == HttpStatusCode.NotFound) return Enumerable.Empty<TorrentSearchResult>(); throw; } var document = DocumentBuilder.Html(html); var items = document.All .Where(n => n.TagName == "TR" && (n.ClassName == "even" || n.ClassName == "odd")); var results = new List<TorrentSearchResult>(); foreach (var item in items) { var tds = item.QuerySelectorAll("td"); var torrentDiv = tds[0].QuerySelector("div[class='iaconbox center floatright']"); var torrentLinks = torrentDiv.QuerySelectorAll("a"); var tlc = torrentLinks.Length; var magnetUri = torrentLinks[tlc - 2].Attributes.First(a => a.Name == "href").Value; var torrentUrl = torrentLinks[tlc - 1].Attributes.First(a => a.Name == "href").Value; var torrentNameDiv = tds[0].QuerySelector("div[class='torrentname']"); var torrentName = torrentNameDiv.QuerySelectorAll("a").First(n => n.ClassName == "cellMainLink").TextContent; var sizeParts = tds[1].TextContent.Split(' '); var sizeStr = sizeParts[0]; var sizeType = sizeParts[1]; var size = double.Parse(sizeStr, new NumberFormatInfo {CurrencyDecimalSeparator = "."}); if (sizeType == "KB") size = Math.Round(size/1024, 2); else if (sizeType == "GB") size = size*1024; if (minSize.HasValue && size < minSize.Value) continue; if (maxSize.HasValue && size > maxSize.Value) continue; var seed = int.Parse(tds[4].TextContent); if (minSeed.HasValue && seed < minSeed.Value) continue; int? files = null; int filesTmp; var filesStr = tds[2].TextContent; if (int.TryParse(filesStr, out filesTmp)) files = filesTmp; var age = tds[3].TextContent; var leech = int.Parse(tds[5].TextContent); results.Add(new TorrentSearchResult(service, this, torrentUrl, torrentName, seed, leech, size, files, age, magnetUri)); } return results; } }
/// <summary> /// Sets the quality of the sent video data. /// </summary> internal void SetVideoEncoderQuality(VideoQuality videoQuality) { softPhone.VideoEncoderQuality = videoQuality; }
public async Task<IEnumerable<ITorrentSearchResult>> Search(string search, VideoQuality videoQuality = VideoQuality.Any, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null, ITorrentDownloader service = null) { if (videoQuality != VideoQuality.Any) { switch (videoQuality) { case VideoQuality.P720: search += " 720p"; break; case VideoQuality.P1080: search += " 1080p"; break; } } var excludeList = string.IsNullOrEmpty(excludeKeywords) ? Enumerable.Empty<string>().ToList() : excludeKeywords.Split(' ').Select(e => e.Trim()).Where(e => !string.IsNullOrEmpty(e)).Distinct().ToList(); var results = new List<TorrentSearchResult>(); var url = Helper.CombineUrls(Settings.BaseUrl, "search", search); using (var client = new NovaromaWebClient()) { var html = await client.DownloadStringTaskAsync(url); var document = DocumentBuilder.Html(html); var items = document.QuerySelectorAll("table[id='searchResult'] tr"); foreach (var item in items) { var tds = item.QuerySelectorAll("td"); if (tds.Length < 4) continue; var mainTd = tds[1]; var anchor = mainTd.Children[0].Children[0]; var torrentUrl = Helper.CombineUrls(Settings.BaseUrl, anchor.Attributes.First(a => a.Name == "href").Value); var torrentName = anchor.TextContent.Trim(); if (excludeList.Any(e => torrentName.IndexOf(e, StringComparison.OrdinalIgnoreCase) > 0)) continue; var magnetUri = tds[1].Children[1].Attributes.First(a => a.Name == "href").Value; var detDescNode = tds[1].QuerySelectorAll("font[class='detDesc']").First(); var detDesc = detDescNode.TextContent; var idx1 = detDesc.IndexOf(",", StringComparison.OrdinalIgnoreCase); var idx2 = detDesc.IndexOf(",", idx1 + 1, StringComparison.Ordinal); var age = detDesc.Substring(0, idx1).Replace("Uploaded", string.Empty).Trim(); if (idx2 == -1) idx2 = detDesc.Length; var sizeParts = detDesc.Substring(idx1 + 1, idx2 - idx1 - 1).Replace("Size", string.Empty).Trim().Split((char)160); var sizeStr = sizeParts[0]; var sizeType = sizeParts[1]; var size = double.Parse(sizeStr, new NumberFormatInfo { CurrencyDecimalSeparator = "." }); if (sizeType == "KiB") size = Math.Round(size / 1024, 2); else if (sizeType == "GiB") size = size * 1024; if (minSize.HasValue && size < minSize.Value) continue; if (maxSize.HasValue && size > maxSize.Value) continue; var seed = Convert.ToInt32(tds[2].TextContent); if (minSeed.HasValue && seed < minSeed.Value) continue; var leech = Convert.ToInt32(tds[3].TextContent); results.Add(new TorrentSearchResult(service, this, torrentUrl, torrentName, seed, leech, size, null, age, magnetUri)); } } return results; }
public virtual async Task<IEnumerable<ITorrentSearchResult>> SearchMovie(string name, int? year, string imdbId, VideoQuality videoQuality = VideoQuality.Any, string extraKeywords = null, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null) { var results = new ConcurrentBag<ITorrentSearchResult>(); var tasks = MovieProviders.RunTasks(p => p.SearchMovie(name, year, imdbId, videoQuality, extraKeywords, excludeKeywords, minSize, maxSize, minSeed, this) .ContinueWith(t => results.AddRange(t.Result)), ExceptionHandler ); await Task.WhenAll(tasks); return results.OrderByDescending(r => r.Seed); }
public virtual async Task<IEnumerable<ITorrentSearchResult>> Search(string query, VideoQuality videoQuality = VideoQuality.Any, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null) { var providers = ((IEnumerable<ITorrentProvider>)MovieProviders).Union(TvShowProviders); var results = new ConcurrentBag<ITorrentSearchResult>(); var tasks = providers.RunTasks(p => p.Search(query, videoQuality, excludeKeywords, minSize, maxSize, minSeed, this) .ContinueWith(t => results.AddRange(t.Result)), ExceptionHandler ); await Task.WhenAll(tasks); return results.OrderByDescending(r => r.Seed); }
public virtual async Task<IEnumerable<ITorrentSearchResult>> SearchTvShowEpisode(string name, int season, int episode, string episodeName, string imdbId, VideoQuality videoQuality = VideoQuality.Any, string extraKeywords = null, string excludeKeywords = null, int? minSize = null, int? maxSize = null, int? minSeed = null) { var results = new ConcurrentBag<ITorrentSearchResult>(); var tasks = TvShowProviders.RunTasks(p => p.SearchTvShowEpisode(name, season, episode, episodeName, imdbId, videoQuality, extraKeywords, excludeKeywords, minSize, maxSize, minSeed, this) .ContinueWith(t => results.AddRange(t.Result)), ExceptionHandler ); await Task.WhenAll(tasks); return results .Where(r => { int? s, e; Helper.DetectEpisodeInfo(r.Name, name, out s, out e); return (s == null || s == season) && e == episode; }) .OrderByDescending(r => r.Seed) .ToList(); }