微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Java:使用 com.github.axet.VGet 下载 YouTube 视频时出现错误 (DownloadError)

如何解决Java:使用 com.github.axet.VGet 下载 YouTube 视频时出现错误 (DownloadError)

我正在尝试使用 com.github.axet.vget 库下载 YouTube 视频。我使用我的 IntelliJ Idea IDE 导入了这个库。使用简单的代码示例时,出现以下错误

Exception in thread "main" com.github.axet.wget.info.ex.DownloadError: com.github.axet.wget.info.ex.DownloadRetry: empty video download list,wait until youtube will process the video
    at com.github.axet.vget.VGet.retry(VGet.java:181)
    at com.github.axet.vget.VGet.extract(VGet.java:421)
    at com.github.axet.vget.VGet.download(VGet.java:499)
    at com.github.axet.vget.VGet.download(VGet.java:101)
    at com.youtube.converter.Main.main(Main.java:32)
Caused by: com.github.axet.wget.info.ex.DownloadRetry: empty video download list,wait until youtube will process the video
    at com.github.axet.vget.vhs.YouTubeParser.extract(YouTubeParser.java:855)
    at com.github.axet.vget.info.VGetParser.info(VGetParser.java:17)
    at com.github.axet.vget.VGet.extract(VGet.java:415)
    ... 3 more

我在不同的机器/计算机上尝试了我的脚本,并使用了许多不同的视频链接(URL)。但是,它们都在运行时返回了错误。 我使用的是 VGet 版本 1.2.6,但我也尝试了 1.2.5 和 1.2.0。

import com.github.axet.vget.VGet;

import java.io.File;
import java.net.URL;
import java.net.MalformedURLException;

public class Main {

    public static void main(String[] args) throws MalformedURLException {

        String url = "https://www.youtube.com/watch?v=9FWIG_c6PfI";
        String urlPlaylistVideo = "https://www.youtube.com/watch?v=l0U7SxXHkPY&list=PLbpi6ZahtOH7eFIp5Cc15AnhiIdkjgmdC&index=1";

        String path = "C:\\Users\\Username\\OutputFolder";

        VGet vg = new VGet(new URL(url),new File(path));
        vg.download();

    }

}

此 Java 脚本中的 URL 是示例。注意到我尝试了很多不同的视频链接(网址)。

如果有人知道如何解决这个问题:欢迎提供任何解决方案或提示

我在 StackOverflowGitLab 发现了一些类似的问题,但都没有答案。 关于 VGet 的信息:https://github.com/laserjim/vget

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。