如何使用 java 从 http url(视频流链接)下载视频文件?

可能重复:
如何从现场获取视频链接使用 java 流式传输视频?

大家好!

我必须开发一个应用程序来将任何视频文件从 http url(视频流)下载到本地系统.有没有免费的api.还有一些网站,如 youtube.这里没有可用于视频文件的直接链接.在这种情况下,我怎样才能获得确切的视频文件链接.我还需要java源来保存来自url的视频文件.

I have to develop an application to download any video file from http url (video stream) to local system. Is there any free api for this. also there are some sites like youtube. Here no direct links available for video file. In such cases how can I get the exact video file link. Also I need java source to save video file from url.

谢谢!

推荐答案

(免责声明:我是的作者休息).

这是一个关于如何将谷歌地图图像直接下载到磁盘的代码示例:

Here is a code-example on how to download a google map image straight to disk:

Resty r = new Resty();
File f = r.bytes("http://maps.google.com/maps/api/staticmap?size=512x512" +
  "&maptype=hybrid&markers=size:mid%7Ccolor:red%7C37.815649,-122.477646&sensor=false").
  save(File.createTempFile("google", ".png"));

相关文章