I am trying to write a Java program to download youtube videos. When I search in internet I found that most of the codes use to get the index of "url_encoded_fmt_stream_map=" from the YouTube page source. I think this is to extract the exact video format link. But I am not able to construct the exact video link as I dont know the structure of the exact video link of YouTube.

Could you please help me to construct the video link.
Or
If any one tried then could you please upload the working code.

Thanks in advance :)

YouTube Terms of Service, section 5B says:

You shall not download any Content unless you see a “download” or similar link displayed by YouTube on the Service for that Content. You shall not copy, reproduce, distribute, transmit, broadcast, display, sell, license, or otherwise exploit any Content for any other purposes without the prior written consent of YouTube or the respective licensors of the Content

Unless you can provide some kind of convincing assurance that you will only use yur Java program in full compliance with YouTube's Terms of Service, and with the full written consent of the Copyright owner(s), this thread cannot go any further.

Thanks for the reply :) I know I cannot go further but one think I need to know is that there are a lot of websites and applications from where we can download Youtube Videos. Do they also provide convincing assurance to Youtube or are they violating YouTube's Terms of Service.

Yes, of course you're right. There are also many websites where you can download pornography or pirated versions of software. or discuss hacking techniques. Here on DaniWeb we don't do any of those things, nor do we support, help, or condone anyone else doing them. It's not YouTube that you have to convince here, it's Dani.

We will be very happy to help you with your programming projects, but only if they are 100% legal.

This question has already been answered. Start a new discussion instead.