flagbug / YoutubeExtractor

A .NET library, that allows to download videos from YouTube and/or extract their audio track (currently only for flash videos).
816 stars 374 forks source link

AudioDownloader does't work #232

Open ChriChri4 opened 7 years ago

ChriChri4 commented 7 years ago

Hi guys!

I have a problem when I try to extract the audio from a Youtube's video. I tried with many videos but I got the same error: Exception System.InvalidOperationException' in System.Core.dll This error appears at the start of the audioDownloader.Execute() when I try to create a VideoInfo object. I tried with the example code but I found the error in these rows:

`VideoInfo video = videoInfos

            .Where(info => info.CanExtractAudio)

            .OrderByDescending(info => info.AudioBitrate)

            .First();`

Someone have an idea for the problem's solution?

Thanks in advance

ChriChri4

kvoeten commented 7 years ago

Encountering the same issue. It seems to come from the info object not containing these items. (CanExtractAudio/AudioBitrate) something is probably going wrong when creating this object for audio files. (Video download works totally fine)

jprzimba commented 7 years ago

I've same issue.... it can't extrack audios and freezes my app

ghost commented 7 years ago

Yep. I am having the exact same issue. YoutubeExtractor is very weak without this feature. Does any one managed to fix this ?

jprzimba commented 7 years ago

I'm using a method that i've to use ffmpeg.exe My method is download video and execute ffmpeg.exe with arguments of video and it extract audio and delete video That is my solution

ChriChri4 commented 7 years ago

@tryller

Yes, I tried your method 2 days ago and it works, but I have another problem now: in very more videos that I try to download I have this issue:

'System.Net.WebException' in System.dll Remote server error: (403) forbidden I found only two videos that don't give me this error. I tried to disable the firewall of Windows but doesn't work. Any ideas?

Thank you

ghost commented 7 years ago

@tryller ..I have also tried above methods,But its not working..It is giving 403 forbidden,For example I have extracted this url using your project dll(not from nuget),It is giving 403 error.. https://r9---sn-h557sn7r.googlevideo.com/videoplayback?keepalive=yes&itag=251&ei=hPueWLqWLdK4ogP92pXoDQ&sparams=clen,dur,ei,gcr,gir,id,initcwndbps,ip,ipbits,itag,keepalive,lmt,mime,mm,mn,ms,mv,pl,requiressl,source,upn,expire&requiressl=yes&mt=1486814065&key=yt6&initcwndbps=517500&ipbits=0&pl=24&lmt=1449637525229569&expire=1486835684&source=youtube&upn=GhuUbb0ZRWU&gcr=in&mm=31&gir=yes&mn=sn-h557sn7r&id=o-APj_BKI3H_wcIeWAeNqc1zJwlsGdG08OFpWoYL5ycNZb&dur=258.041&mime=audio/webm&mv=m&ms=au&clen=4296050&ip=103.6.159.156&signature=C6369615F2AAE31447843831E3ABCDE3DA665380B4.A18DB620D22A2B9C26282E9343DC0F8246473010&ratebypass=yes

Sicryption commented 7 years ago

Problem still exists.

fuzzewuzze commented 7 years ago

The problem if you look at all the videos you get back from videoInfo is that every item in the array has CanExtractAudio as false, so it errors out because none of the items meet its criteria. Im not sure why everything now says it cant extract audio.

typetrait commented 7 years ago

I may be wrong but the CanExtractAudio property from VideoInfo just returns true if the VideoType is equals to VideoType.Flash and it never returns as flash, causing it to always be false making the query return nothing.

Check #191.