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

Problem downloading high quality videos #235

Open ghost opened 7 years ago

ghost commented 7 years ago

It seems that there is a thing with high quality resolutions(higher than 720p). Many times if you ask for high resolution, youtube extractor downloads only the video WITHOUT the audio emded.... plus that windows cannot open it(you can open it only through VLC or any similar software). 720p is the higher it can gets without any problem(so far). Example link: https://www.youtube.com/watch?v=9xqHvVjQH2Q

EDIT: After alot of tries... i figured out that this happens also with lower resolutions too. For example in this video: https://www.youtube.com/watch?v=MNlo4z6k5C8 I think that this is a major problem with YoutubeExtractor now.

CodeA42 commented 7 years ago

I have the same issue I am going to download the audio only and add it to the higher quality. In theory it should work.

ghost commented 7 years ago

In theory. Your theory has 2 major problems. The first problem is that the higher quality version... is not only audio-nulled, but it's corrupted in the first place. The second problem is that the AudioDownload feature of YoutubeExtractor doesn't work either.... so how you manage to download the audio only ?

mysteryx93 commented 7 years ago

Audios and videos come as separate streams. You need to muxe both files using FFMPEG. Then, Windows Media Player might not support VP9 videos if you don't have the codecs installed.

ghost commented 7 years ago

Ok, mybe i am little dump... but what muxe means ?? I don't know if they come as seperate streams. What i know is that in some videos the video comes with it's sound...and some times it comes without it. And i think that the file is broken, because in the details of these "broken" videos... i don't see information such as the resolution e.t.c. + windows media player doesn't open them... And even through VLC manage to open these "broken" videos... it doesn't seem to know their length. It just play them like they are a live video or something. No ability to see the actual length of the video. If i am doing something wrong please correct me, and i would be more than happy to "close" this issue :)

mysteryx93 commented 7 years ago

That's because you are downloading audio/video streams, not a file per se. https://www.encoding.com/blog/2014/01/13/whats-difference-codecs-containers/

To combine an audio stream and a video stream into a container file: http://stackoverflow.com/questions/12938581/ffmpeg-mux-video-and-audio-from-another-video-mapping-issue

Muxing means to change the container and combine streams without re-encoding the streams.

With YouTube, some older formats have both audio and video together, but newer formats have it separate.

ghost commented 7 years ago

@sashko98 -Please share the solution for Audio only downloads,I am eagerly waiting for this,As Audio urls are not working in youtubeextractor.

mysteryx93 commented 7 years ago

What do you mean by "audio-only downloads"? Is there such a thing as video-less videos on YouTube?

ghost commented 7 years ago

Yes,Almost for every videos there has a audio link which can be playable and downloadable.Then for what purpose this library has audiodownloader.

mysteryx93 commented 7 years ago

The part you missed is "FLV Extract". Unless you're trying to extract the audio out of a FLV file, which is outdated, you don't need that class. You download the audio in the same way you download the video.

ghost commented 7 years ago

Still it did not worked.Also I have investigated decipherer signature,the recent change in signature will work for some of urls and it will not work for some other urls for example-

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

Thanks for help.

mysteryx93 commented 7 years ago

What is the URL you're trying to download?