Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Sites were you put in a youtube url, then it goes and gives you an mp4 or mp3 of the video.

How does that work?

Viewing the source of a youtube page gives me:

 <video class="video-stream html5-main-video" x-webkit-airplay="allow" data-youtube-id="q9ioaNWaqtw" src="blob:http%3A//" style="width: 640px; height: 360px; left: 0px; top: 0px; -webkit-transform: none;"></video>

Just going to the src gives you nothing. As an answer, oliver says you can just "simply download them directly". How do those sites do that?

I'm planning to make one. What pieces of information, specifically, should I be targeting?

Is there any sort of open source youtube downloader I can take a look at?

share|improve this question

marked as duplicate by random Jul 2 '14 at 15:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 1 down vote accepted

YouTube download websites determine the location of the FLV file that is served through the YouTube player. It essentially reverse engineers the Java (and now HTML5) that serves the video and gets the source.

It then prompts your browser to start downloading that FLV file, or it converts it in the cloud for you to download in the format you want. All of this is being done with VBScript or Visual Basic and Java.

The reason you can't view the source file in the page's source code is because YouTube doesn't serve the file in plaintext HTML, it does it using the video player on the backend.

share|improve this answer
Can you be more specific? I'm planning to make one. What pieces of information, specifically, should I be targeting? – Houseman Oct 14 '13 at 17:19
OWiz, doing so is a direct violation of Youtube's Terms of Use: – ChrisInEdmonton Oct 14 '13 at 17:23
@ChrisInEdmonton I figured. – Houseman Oct 14 '13 at 17:40
But can I get to the URL by disabling the HTML5 player and reverting to the Flash player at – gparyani Oct 14 '13 at 17:42
@OWiz I take it you're doing this in VBScript? That's how all the online ones are doing it on the backend. There are plenty of tutorials I found for "creating youtube downloaders in Visual Basic" – Moses Oct 14 '13 at 17:48

The files are on YouTubes servers. They are just streamed to your client. You could just as well simply download them directly.

The only difference with these sites is, that they're also serving you advertisements.

share|improve this answer
AFAIK, there is no url that you can simply go to and have a video download to your computer, as opposed to going to a url and downloading your OpenID avatar. The files appear to be somewhat protected from "just downloading them" – Houseman Oct 14 '13 at 17:11
@OWiz: There are several browser extensions and userscripts out there that implement this "feature". You can just look at their source code and see how it works. There is nothing special about it. – Oliver Salzburg Oct 14 '13 at 17:39
Oh, it never occurred to me to simply look at the source of one of those things. Thanks – Houseman Oct 14 '13 at 17:41

Not the answer you're looking for? Browse other questions tagged .