GithubHelp home page GithubHelp logo

tyrrrz / youtubeexplode.converter Goto Github PK

View Code? Open in Web Editor NEW
86.0 10.0 26.0 151 KB

Muxes and converts videos from YoutubeExplode

License: Other

C# 100.00%
youtube youtubeexplode converter muxer downloader hacktoberfest

youtubeexplode.converter's Introduction

YoutubeExplode.Converter

Note: The contents of this repository have been moved inside the main repo.

youtubeexplode.converter's People

Contributors

tyrrrz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youtubeexplode.converter's Issues

Running on Android: path1 cannot be nulled

case1:
var client = new YoutubeClient();
var converter = new YoutubeConverter(client);

case2:
var converter = new YoutubeConverter();

the same error
path1 cannot be nulled;

InvalidOperationException: FFmpeg exited with a non-zero exit code (-1073741819)

Version

The newest

Details

I tried to download a 8k video, but I get an error from ffmpeg

Standard error:
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'E:\Users\<my name>\Eigene Videos\QLED 8K Unrivaled realism in real 8K  Samsung.mp4.stream-1.tmp':
  Metadata:
    encoder         : google/video-file
  Duration: 00:01:38.46, start: -0.007000, bitrate: 128 kb/s
    Stream #0:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
[libaom-av1 @ 063177c0] 1.0.0-2379-g861fd02c8
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'E:\Users\<my name>\Eigene Videos\QLED 8K Unrivaled realism in real 8K  Samsung.mp4.stream-2.tmp':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6av01mp41
    creation_time   : 2020-06-04T22:23:24.000000Z
  Duration: 00:01:38.43, start: 0.000000, bitrate: 28787 kb/s
    Stream #1:0(und): Video: av1 (Main) (av01 / 0x31307661), yuv420p(tv, bt709), 7680x4320, 1098 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
    Metadata:
      creation_time   : 2020-06-04T22:23:24.000000Z
      handler_name    : ISO Media file produced by Google Inc.
[libaom-av1 @ 06e22900] 1.0.0-2379-g861fd02c8
Stream mapping:
  Stream #1:0 -> #0:0 (av1 (libaom-av1) -> h264 (libx264))
  Stream #0:0 -> #0:1 (opus (native) -> aac (native))

Steps to reproduce

Using this line of code:
await youtube.Videos.DownloadAsync(streamInfos, new ConversionRequestBuilder($"filename{streamInfo.Container}").Build(), progressHandler);

No process is associated with this object when combining streams

When downloading video and audio separately, i can see both files get created in the filesystem correctly, however then the DownloadAndProcessMediaStreamsAsync method throws a System.InvalidOperationException: 'No process is associated with this object.'

System.InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_HasExited()
at CliWrap.Internal.ProcessEx.Dispose()
at CliWrap.Command.ExecuteAsync(ProcessEx process, CancellationToken cancellationToken)
at YoutubeExplode.Converter.Internal.FFmpeg.ConvertAsync(String outputFilePath, IReadOnlyList1 inputFilePaths, String format, String preset, Boolean avoidTranscoding, IProgress1 progress, CancellationToken cancellationToken)
at YoutubeExplode.Converter.YoutubeConverter.DownloadAndProcessMediaStreamsAsync(IReadOnlyList1 streamInfos, String filePath, String format, ConversionPreset preset, IProgress1 progress, CancellationToken cancellationToken)

This only started happening in the past few days, nothing has changed, we haven't touched our code since it was last working, videos that worked a few days ago do not work today

Converting to WAV format

I am able to get the MP3 output, but does the converter include an option to save to WAV instead of MP3?

Default constructor of YoutubeConverter throws an exception on Xamarin

Hello,

I'm attempting to use your library for a xamarin forms project. I'm currently calling your library from a .net standard 2.0 library. I keep getting an system exception calling "new YoutubeConverter(client)". It says "Value cannot be null.\nParameter name: path1".

It's really easy to create. Just create a blank xamarin forms app using .net standard 2.0. Add your library via nuget. Then call your example code in the templated mainpage.xaml.cs

The code example I'm using is from your example...
var client = new YoutubeClient();
var converter = new YoutubeConverter(client);

Error from ffmpeg when download webm

Thanks for your great library! Wish I had seen it earlier.

When I download webm file, CPU goes to high load, a webm file is written only for a length of some seconds. In the task manager I see a high load in ffmpeg, when I cancel the ffmpeg task the error dialog from my try/catch code with ffmpeg error comes up.
With mp4 everything works fine! I use the last ffmpeg 64bit version

await converter.DownloadAndProcessMediaStreamsAsync(streamInfos, videoTitle, "webm");
thanks!

Screenshot (100)

Mix various audios?

Hello , is posible mix various mp3 (10 files mp3) ??
if is posble how can do?

Win32Exception

System.ComponentModel.Win32Exception
HResult=0x80004005
Message=The system cannot find the file specified
Source=System
StackTrace:
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at CliWrap.Internal.CliProcess.Start()
at CliWrap.Cli.StartProcess()
at CliWrap.Cli.d__30.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at YoutubeExplode.Converter.YoutubeConverter.d__5.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at mPlayer.MusicDownload.<MaterialFlatButton1_Click>d__2.MoveNext() in C:\Users\Matt\source\repos\mPlayer\MusicDownload.cs:line 68

CODE:

    var client = new YoutubeClient();
            var converter = new YoutubeConverter();
            string link = SearchBoxInput.Text;
            string id = YoutubeClient.ParseVideoId(link);
            var video = await client.GetVideoAsync(id);

            var streamInfoSet = await client.GetVideoMediaStreamInfosAsync(id);
            var audioStreamInfo = streamInfoSet.Audio.WithHighestBitrate();


            var mediaStreamInfos = new MediaStreamInfo[] { audioStreamInfo };


            var title = video.Title;

            await converter.DownloadAndProcessMediaStreamsAsync(mediaStreamInfos, title + ".mp3", "mp3");

Converted file too big compared to original video

Hello, I tried with some youtube videos, but the result video is too big in size
For example, the video 1080p without audio size is 46MB
After download and convert (using your example code), the video file size is ~ 170MB. How can I make it smaller (about 50MB = video size + audio size)

Linux based OS

Is this possible on linux based os? I mean which ffmpeg binary I should use?

Win32Exception: Access is denied

I have the following code:

var info = await client.GetVideoMediaStreamInfosAsync(searchArray[0].Id);
var converter = new YoutubeConverter(client, Directory.GetCurrentDirectory());
await converter.DownloadVideoAsync(info, "song.opus", "opus");

When the 3rd line runs, I get a Win32Exception: Access is denied. Did I do something wrong or...?

Small issue when downloading/cloning

Not sure if this belongs here exactly since it's not an issue with the library from NuGet and more to do with Cloning/Downloading the project, but I've done so so I can update my old branch of this to work with the new YoutubeExplode project rewrite and uh, something's a bit off since all the dependencies seem to be missing according to Visual Studio. Would anyone happen to have a solution for this? Not sure if it's something about how this was packed to be uploaded or something I did on my end...
image

DownloadAndProcessMediaStreamsAsync replacement

Sorry for misplacing this request earlier, the example does not appear to cover our previous use of DownloadAndProcessMediaStreamsAsync. Should I simple be using the YouTubeClient to download as in the example?
My code:

                'Download the file locally.
                Dim ytClient As New YoutubeClient()
                'Dim converter = New YoutubeConverter(ytClient, _FfmpegPathAndFileName)
                Dim ytSource = New FileInfo(_WorkingDirectory.FullName & "\source\" & "source.mp4")

                'Get All Stream info(s)
                Dim mediaStreamInfoSet = ytClient.Videos.Streams.GetManifestAsync(ytId).GetAwaiter().GetResult()

                'Select Highest Quality Audio Stream
                Dim audioStreamInfo = Retry.Do(Function() mediaStreamInfoSet.GetAudioOnly().WithHighestBitrate(), New TimeSpan(0, 0, 1), 3)

                'Select Highest Quality Video Stream
                Dim videoStreamInfo = Retry.Do(Function() mediaStreamInfoSet.GetVideoOnly().WithHighestVideoQuality(), New TimeSpan(0, 0, 1), 3)

                'Higest Muxed Quality Stream
                Dim muxedStreamInfo = Retry.Do(Function() mediaStreamInfoSet.GetMuxed().WithHighestVideoQuality(), New TimeSpan(0, 0, 1), 3)

                Dim mediaStreamInfos
                'Combine them into a collection
                If muxedStreamInfo.Resolution.Width > videoStreamInfo.Resolution.Width Then
                    ' Use the muxed as it is higher resolution.
                    mediaStreamInfos = New IStreamInfo() {muxedStreamInfo}
                Else
                    mediaStreamInfos = New IStreamInfo() {audioStreamInfo, videoStreamInfo}
                End If


                'Download and combine into one file
                Await Retry.Do(Function() converter.DownloadAndProcessMediaStreamsAsync(mediaStreamInfos, ytSource.FullName, "mp4"), New TimeSpan(0, 0, 2), 3)

Exception: Method not found: 'Int64 YoutubeExplode.Videos.Streams.FileSize.get_TotalBytes()

I'm Using Youtube explode 6.0.0.0
and YoutubeExplode.Converter 2.0.2.0 which I believe are the latest versions.

When I look at the streamInfoVideo and streamInfoAudio objects they do have a size property that is set.

Code Snip below:
using YoutubeExplode;
//using YoutubeExplode.Models.MediaStreams;
using YoutubeExplode.Videos.Streams;
using YoutubeExplode.Converter;
using YoutubeExplode.Common;

StreamManifest streamManifest = await client.Videos.Streams.GetManifestAsync("https://youtu.be/" + id);
// Get highest quality video-only stream
IStreamInfo streamInfoVideo = streamManifest.GetVideoOnlyStreams().GetWithHighestVideoQuality();
// Get highest quality Audio-only stream
IStreamInfo streamInfoAudio = streamManifest.GetAudioOnlyStreams().GetWithHighestBitrate();

//Set File extension explicitly
//ext = streamInfoVideo.Container.Name;
ext = "mp4";
// Download and process them into one file

await client.Videos.DownloadAsync(streamInfos, new ConversionRequestBuilder(Path.Combine(path, $"{titleTemp}.{ext}")).Build());

I get an exception at this point:
Exception: Method not found: 'Int64 YoutubeExplode.Videos.Streams.FileSize.get_TotalBytes()

Separate the download and the conversion to separate threads

When doing this:

// Download and process them into one file
await converter.DownloadAndProcessMediaStreamsAsync(streamInfos, "video.mp4", "mp4");

The downloads take place and then it must convert before continuing to download.
I suggest that these are separate tasks and should be split into separate threads. That way downloads can continue to stream while conversion takes place.

Example:
Downloading 5 files
Time Spent downloading =D
Time Spent Converting= C

Currently
DCDCDCDCDC

Suggestion

DDDDD
__CCCCC

Time Difference
DCDCDCDCDC <---- Current
DDDDDC <----- New Suggestion
(Conversions are happening simultaneous to downloads, except for the last download, of course)

Thanks for some wonderful code btw.

System cannot find the File

Hello,

I tried this Code:

grafik

when I run my Programm to Download the Video it always says that the System cannot find the File.

Since I am a beginner in C# I am a little bit clueless.

Hope someone can help me.

My goal is to get the Video with the Audio and the Video on Max Quality

Cannot find the file path when merging audio and video

Hey, I've been using your code for one of my projects and it's been working great, however, when using YouTube Converter, I get the error "The system cannot find the specific file" when merging a video and audio stream.

This is a code snippet where I get the error:
string filePath = Constants.DOWNLOAD_LOCATION + title; await converter.DownloadAndProcessMediaStreamsAsync(mediaStreamInfos, filePath, "mp4", progress);

The DOWNLOAD_LOCATION is "@"C:\Users\Name\Desktop\New folder".

No matter what I change the "filePath" to, I get the same error. Perhaps I'm doing something wrong as I'm still a beginner with C#.

Could you please assist?

Thanks bro!

IProgress<T> may report duplicate progress values

It happens sometimes when I try do download a playlist (works especially when one video is large)

Here's an example:

private static IProgress<double> prog = new Progress<double>(HandleProgress);

await converter.DownloadAndProcessMediaStreamsAsync(mediaStreamInfos, "path", "mp4", prog);

private static void HandleProgress(double progress) 
{
	Console.WriteLine(progress.ToString()
}

The result:
https://gist.github.com/BlauFx/1fbefc1bfc5d5faeac2ceb7a31a2f941#file-result-L1622

As you can see at line 1622 or at 3332
the number 1 is twice there

CliWrap.Exceptions.CommandExecutionException: 'Underlying process reported a non-zero exit code (-1073741819)

This video downloads to about 20% and then always gives me the following exception:

CliWrap.Exceptions.CommandExecutionException: 'Underlying process reported a non-zero exit code (-1073741819).
This exception was originally thrown at this call stack:
    CliWrap.Command.ExecuteAsync(CliWrap.Internal.ProcessEx, System.Threading.CancellationToken)
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    YoutubeExplode.Converter.FFmpeg.ExecuteAsync(System.Collections.Generic.IReadOnlyList<string>, string, string, string, bool, System.IProgress<double>, System.Threading.CancellationToken)
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(System.Threading.Tasks.Task)
    YoutubeExplode.Converter.ConversionExtensions.DownloadAsync(YoutubeExplode.Videos.VideoClient, System.Collections.Generic.IReadOnlyList<YoutubeExplode.Videos.Streams.IStreamInfo>, YoutubeExplode.Converter.ConversionRequest, System.IProgress<double>, System.Threading.CancellationToken)
    System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)

The video id is:
lDK9QqIzhwk

YoutubeExplode v5.1.8 / YoutubeExplode.Converter v2.0.0

"The system cannot find the file specified"

When performing a join with a 1080p mp4 video and another audio mp4 stream, the video downloads into the first tmp file and then (I assume) the audio downloads into the second tmp file, but after that they both dissappear , I get the following error:

"The system cannot find the file specified"

For an example, I am trying to join Video ID of oyA7Ucnmje4

I see this file first:
"360hometours.ca - Grand Home Design _ Modern Architecture _ Vancouver [1080p].mp4.stream-1.tmp"
Then for a split second I see this one:
"360hometours.ca - Grand Home Design _ Modern Architecture _ Vancouver [1080p].mp4.stream-2.tmp"
Then it gives the exception.
Both files disappear.

Here is my code:
var ytClient = new YoutubeClient();
IProgress idblProgress = new Progress(ReportProgress);
List<YoutubeExplode.Videos.Streams.IStreamInfo> lMSI = new List<YoutubeExplode.Videos.Streams.IStreamInfo>();
lMSI.Add(_VideoStreamInfo);
lMSI.Add(_AudioStreamInfo);
_Status = YouTubeDownloadStatus.Fetching;
ConversionRequest CR = new ConversionRequestBuilder(sPathAndFile).Build();
await ytClient.Videos.DownloadAsync(lMSI, CR, idblProgress, _CT);

Here is the stack trace:
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at CliWrap.Internal.ProcessEx.Start()
at CliWrap.Command.d__46.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at YoutubeExplode.Converter.FFmpeg.d__3.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at YoutubeExplode.Converter.ConversionExtensions.d__2.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at YTFetch.ucYouTubeFetch.<ucYouTubeDownload_Load>d__34.MoveNext() in C:\Projects\YTFetch\YTFetch\ucYouTubeFetch.cs:line 226

I am trying to save to location:
C:\External\D1\Media\Video\Work\Data\Joined\360hometours.ca - Grand Home Design _ Modern Architecture _ Vancouver [1080p].mp4

I upgraded your projects to the latest stable version.

Also, I can just do the video download and it works, so something in the join is failing.

Rendering Speed when Muxing is too fast, need ability to change ffmpeg preset argument.

Is there a way to prevent that and have it render them together at 24fps?

I might be wrong, but in trying out the converter and combining the streams I wound up with file sizes that are massive in comparison to the MUXED streams of YouTube. I know there's a discrepancy between 720p and 1080p obviously, but the muxed 720p resulted in a fifteen minute video coming out at 56MB, and the Converter's 1080p combined stream gave me a 707MB file. I expected (estimating from the video stream size and the audio stream size) that it should be around 180MB though, and I've been kinda knocking my head against a wall for a while here, but realized the potential explanation might be if FFMPEG is rendering a 60FPS file.

So, am I right? and if I am, is there a way we could boil down FFMPEG's rendered fps to 24 since that's what YouTube plays out any way?

Videos sometimes download and convert to .webm instead of MP4

Example URL:
https://www.youtube.com/watch?v=pgzWxOtk1zg

This will download when downloading 1) Highest Video AND 2) Highest Audio Quality and merge the strreams using ffmpeg to .WEBM file.

I believe this is a bug. ?
Is there a way to force this to be muxed as a MP4? Am I missing something?

Code Example:
var streamManifest = await client.Videos.Streams.GetManifestAsync(id);

// Get highest quality video-only stream
var streamInfoVideo = streamManifest.GetVideoOnly().WithHighestVideoQuality();

// Get highest quality Audio-only stream
var streamInfoAudio = streamManifest.GetAudioOnly().WithHighestBitrate();

var converter = new YoutubeConverter();
// Combine them into a collection
var streamInfos = new IStreamInfo[] { streamInfoAudio, streamInfoVideo };

// Get file extension based on stream's container
ext = streamInfoVideo.Container.Name; <-- Can I Change this to force mp4?

// Download and process them into one file
await converter.DownloadAndProcessMediaStreamsAsync(streamInfos, Path.Combine(path, $"{titleTemp}.{ext}"), "mp4");

// IS THIS A SAFE ALTERNATIVE?
await converter.DownloadAndProcessMediaStreamsAsync(streamInfos, Path.Combine(path, $"{titleTemp}.{"mp4"}"), "mp4");

Thanks

Best way of implementing without dependency of YoutubeExplode ?

I am having troubles implementing this library, I want to be able to include it and not have to worry about the reference of your YoutubeExplode.DLL being in that project also as I modified it myself based on comments to do with JSON structure change with YoutubeExplode here https://github.com/Tyrrrz/YoutubeExplode.

Am using the code from your download audio and video muxed and getting an error likely due to that json issue in the youtubeexplode.dll reference. Will update with error when i have more information

Suggested code on your readme

Here is some suggested code to add after "Download specific streams" section to show the ease of use and capabilities exposed.

Download specific streams - (Highest Quality available)
var youtube = new YoutubeClient();

YoutubeExplode.Videos.Video video = await client.Videos.GetAsync(id);
// Retrieving some values from the video
string title = video.Title;
string titleTemp = video.Title;
string OrigTitle = video.Title;
string author = video.Author;
TimeSpan duration = video.Duration;
DateTime videoUploadDate = video.UploadDate.DateTime;

//Safe Filenames
foreach (char lDisallowed in Path.GetInvalidFileNameChars())
{
title = title.Replace(lDisallowed.ToString(), "");
OrigTitle = OrigTitle.Replace(lDisallowed.ToString(), "");
}
string SafeTitle = title;

StreamManifest streamManifest = await client.Videos.Streams.GetManifestAsync(id);

// Get highest quality video-only stream
IStreamInfo streamInfoVideo = streamManifest.GetVideoOnly().WithHighestVideoQuality();

// Get highest quality Audio-only stream
IStreamInfo streamInfoAudio = streamManifest.GetAudioOnly().WithHighestBitrate();

// Combine them into a collection
var streamInfos = new IStreamInfo[] { streamInfoAudio, streamInfoVideo };

//Set File extension explicitly
ext = "mp4";

// Download and process them into one file
await client.Videos.DownloadAsync(streamInfos, new ConversionRequestBuilder(Path.Combine(path, $"{SafeTitle}.{ext}")).Build());

DownloadAndProcessMediaStreamsAsync throws 403

Метод в половине случаев вызывает внутреннее исключение: HttpRequestException: Код состояния ответа не указывает на успешное выполнение: 403 (Forbidden).

-i-Video #3 [Vp9 3840x1620 25fps]. Audio [Opus 139398 webm 251 3210135]...
-i-Downloading and Converting... [03 Hard Driver - Blow Da Club Down (Official Video)]
-x-Error DownloadAndProcessMediaStreams [https://www.youtube.com/watch?v=Rq-E1jBP6Ss]

Что может быть причиной? это у меня одного так? спустя пол часа из 5 одно видео все таки получилось остальные такие же.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.