Download youtube videos with Java API?

假装没事ソ 提交于 2020-01-11 10:44:12

问题


I found similar questions in stack overflow, and I tried few of solutions. All are outdates. So I am rising a new issue. Please provide me latest solutions if you tried recently please.

I fallow and tried:

How to download videos from youtube on java?

I gone through the youtube-api, it not providing anything to download as I understand the samples provided in Github.

https://developers.google.com/youtube/v3/code_samples/java

It tried with latest VGet API, it working well but it downloading video(mp4) and audia(webm) seperately.

Do you have solution how to combile both.

import com.github.axet.vget.VGet;

public class YoutubeDownloadTool {

    public static void main(String[] args) {
        try {
            String url = "https://www.youtube.com/watch?v=7lFhwXeSidQ";
            String path = "D:\\videos";
            VGet v = new VGet(new URL(url), new File(path));
            v.download();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

回答1:


Downloading of videos is not supported in Youtube API. It is in fact prohibited. Under Terms of Service - II. Prohibitions it is mentioned that:

Prohibited

  1. store copies of YouTube audiovisual content

  2. use the YouTube API intentionally to encourage or promote copyright infringement or the exploitation of copyright-infringing materials;

Also, this SO thread states that is explicitly mentioned in Youtube Page terms

"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 "



来源:https://stackoverflow.com/questions/39933132/download-youtube-videos-with-java-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!