1

Currently i am working on one android application in which we have feature of downloading youtube videos , so does google alllow download of youtube videos in our application

Thanks

bindal
  • 1,940
  • 1
  • 20
  • 29
  • There are the sites likes `tubidy.com` and `vuclip.com` which provide download of youtube videos, so There may a way – Pragnani Apr 10 '13 at 09:59
  • so is there any agreement or terms that we have to accept for downloading videos? – bindal Apr 10 '13 at 10:01
  • To be frank I don't know, but it is legal because I have seen few apps doing the same. But the hard task here is how do you convert the vidoes? – Pragnani Apr 10 '13 at 10:04
  • i have already implemented that code but i just want to know that if it is legal or not – bindal Apr 10 '13 at 10:06

3 Answers3

4

As per my knowledge you can not directly do this..

Currently what you are doing is, opening a http connection on url and then saving the buffer.

This is not allowed as per thread by google

http://support.google.com/youtube/bin/answer.py?hl=en&answer=56100

But ofcourse there are other ways:

like what i have noticed with other sites is that they themselves upload content on sites like dailymotion etc and then create a new website where they give this video uploader site link and then they say "this is third party content, we do not host this video"

This is basically done to avoid copyright law.

In this case, video creator will have to sue sites like dailymotion and not video uploader, which is not easy for a small player.

But again they have expert lawyers to tell them what they can do to avoid copyright and save their @ss in trouble because they are basically exploiting some loopholes.

So whatever you do, you need expert advice, because directly, it is illegal.

Sunny
  • 1,441
  • 2
  • 13
  • 22
1

No that would be illegal. Google does not allow that. You can only view the videos in a webview.
[Edit]
you can stream the videos in any view. But I dont know the legal repurcussions of that one.

asloob
  • 1,308
  • 20
  • 34
1
URL u = null;
InputStream is = null;  

     try {
              u = new URL(url);
              is = u.openStream(); 
              HttpURLConnection huc = (HttpURLConnection)u.openConnection();//to know the size of video
              int size = huc.getContentLength();                 

          if(huc != null){
              String fileName = "FILE.mp4";
              String storagePath = Environment.getExternalStorageDirectory().toString();
              File f = new File(storagePath,fileName);

              FileOutputStream fos = new FileOutputStream(f);
              byte[] buffer = new byte[1024];
              int len1 = 0;
              if(is != null){
                 while ((len1 = is.read(buffer)) > 0) {
                       fos.write(buffer,0, len1);   
                 }
              }
              if(fos != null){
                 fos.close();
              }
          }                     
     }catch (MalformedURLException mue) {
            mue.printStackTrace();
     } catch (IOException ioe) {
            ioe.printStackTrace();
    } finally {
               try {                
                 if(is != null){
                   is.close();
                 }
               }catch (IOException ioe) {
                     // just going to ignore this one
               }
    }

this works in some cases and doesn't work in some. You need to take the url from the html source code in this case, remove unnecessary things and decode the url to download using this code.

Answer copied from this link

Community
  • 1
  • 1
D'yer Mak'er
  • 1,632
  • 5
  • 24
  • 47
  • Thanks brother for your code but i already have that code but i just only want to know that does google allows this feature in our app or not? – bindal Apr 10 '13 at 10:04
  • Its illegal. http://www.pcadvisor.co.uk/how-to/internet/3420353/is-it-legal-download-youtube-videos/ this link will give the exact reasons for this. you will not find any apps which allow youtube downloader kind of app on the play store for the exact same reason. youtube downloading is only allowed for particular apps designed by google itself. – D'yer Mak'er Apr 10 '13 at 10:12