0

I need to let my app's client paste youtube (or any other website but that later) URL and download just music (mp3) from the specified video.

I was looking for the solution on stackoverflow and google and found that it is in spite of their law. We just cant dowload anything from youtube. In case of doing it, youtube will block our service.

However, I know that there are still available sites, on which we can convert the video to mp3 easily, for example: http://2conv.com And these sites exist in web for really long time.

So how did they avoid youtube-law? How can I download videos from youtube using Java? (I dont ask for code, but just the way how to do this, what to type in google to find the answer)

Thanks for reading! I really need the answer, because downloading from youtube has to be the core-feature of my app

TO BE CLEAR AND NOT DOWN-VOTED:

I am not going to violate youtube terms of service, just asking if there is any way to reconcile my needs with youtube terms?

azalut
  • 4,094
  • 7
  • 33
  • 46
  • Why were I down-voted? – azalut Nov 19 '14 at 16:31
  • You are essentially asking, "How can I violate YouTube's [Terms of Service](https://www.youtube.com/static?template=terms)". The answer is, you should not. – kuporific Nov 19 '14 at 16:35
  • I am not asking how to violate youtube terms of service, but how is it possible for site like 2conv.com to work avoiding it, maybe there is any way to reconcile my needs with youtube-terms – azalut Nov 19 '14 at 16:37
  • 2conv's [Terms of Service](http://2conv.com/terms/) state that "You agree to not use 2conv.com services to upload any content that infringes any patent, trademark, trade secret, copyright or other proprietary rights of any party." YouTube's Terms of Service include, "You agree not to distribute in any medium any part of the Service or the Content without YouTube's prior written authorization, unless YouTube makes available the means for such distribution through functionality offered by the Service (such as the Embeddable Player)." I'm no lawyer, but is what you're trying to do allowed? ... – kuporific Nov 19 '14 at 16:54
  • ... While there are lots of sites like 2conv.com, I suspect that YouTube does not allow what they are doing. Unless YouTube provides a way to get the audio from a video in their [API](https://developers.google.com/youtube/v3/), I don't think it's allowed. – kuporific Nov 19 '14 at 16:56
  • aff not good :( so I have to find another way to do this, do you know any legal service that allows downloading mp3 programatically? – azalut Nov 19 '14 at 17:08
  • Take a look at this: https://stackoverflow.com/a/60854321/5645656 – Cardinal System Mar 25 '20 at 17:43

2 Answers2

2

It's possible, just use Pafy script (Python), this API based on youtube-dl.

You can see more youtube-dl support sites at: https://rg3.github.io/youtube-dl/supportedsites.html

Khang .NT
  • 1,504
  • 6
  • 24
  • 46
1

Unfortunately not possible. Video files are integrated with their audio files. so if you want to extract audio from any video file you should download the whole thing and then extract its audio to mp3 yourself. Every service that does so first fetches the video and then does as mentioned. Make sure not to violate any terms of service.

Morteza Shahriari Nia
  • 1,392
  • 18
  • 24
  • Can't I also download videos for my, personal use? – azalut Nov 19 '14 at 17:09
  • You can definitely download. what ever video you watch on your computer is being downloaded to your computer. So it is definitely possible. (whether it is ok to do so or not is another question) – Morteza Shahriari Nia Nov 19 '14 at 17:13
  • Here I found a bunch of links http://stackoverflow.com/questions/5238175/how-can-i-use-java-to-download-a-video-file-from-http-urlvideo-streaming-link http://stackoverflow.com/questions/2498359/downloading-you-tube-videos http://stackoverflow.com/questions/9964218/downloading-embedded-videos Use everything legibly – Morteza Shahriari Nia Nov 19 '14 at 17:14
  • You can do this with `FFMpeg`. – pookie May 10 '16 at 15:16