/// <summary> /// /// </summary> /// <param name="client">YoutubeClient instance</param> /// <param name="ffmpegExePath">//Path to the ffmpeg.exe file used to mux audio&video stream. It should be located in wwwrooot/ffmpeg.exe</param> public YoutubeClientHelper(IYoutubeClient client, string ffmpegExePath) { this.client = client; converter = new YoutubeConverter(client, ffmpegExePath); }
public YoutubeClientHelper(IYoutubeClient client, string installLocation) { this.client = client; string ffmpegExePath = installLocation + "\\ffmpeg.exe"; //Path to the ffmpeg.exe file used to mux audio&video stream. converter = new YoutubeConverter(client, ffmpegExePath); }
/// <summary> /// Downloads a video to a file using specified format by selecting media streams from the given set. /// </summary> public static Task DownloadVideoAsync(this IYoutubeConverter converter, StreamManifest streamManifest, string filePath, string format, IProgress <double>?progress = null, CancellationToken cancellationToken = default) => converter.DownloadVideoAsync(streamManifest, filePath, format, ConversionPreset.Medium, progress, cancellationToken);
/// <summary> /// Downloads given media streams and processes them into a file using specified format. /// </summary> public static Task DownloadAndProcessMediaStreamsAsync(this IYoutubeConverter converter, IReadOnlyList <IStreamInfo> streamInfos, string filePath, string format, IProgress <double>?progress = null, CancellationToken cancellationToken = default) => converter.DownloadAndProcessMediaStreamsAsync(streamInfos, filePath, format, ConversionPreset.Medium, progress, cancellationToken);