How to download a youtube video in java using VGet

Viewed 232

I've looked several places, and every single website has the same code:

  import java.io.File;
  import java.net.URL;
  import com.github.axet.vget.VGet;


  public class YouTube {

 public static void main(String[] args) {
        try {
            VGet v = new VGet(new URL("https://www.youtube.com/watch?v=ZqGaPi92hY8"), new File("C:\\Users\\User\\Desktop"));
            v.download();
        } catch (Exception e) {
             throw new RuntimeException(e);
        }
    }
}

However, when I run this code, Eclipse spits out this error:

   Exception in thread "main" java.lang.RuntimeException: 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 ytpack.YouTube.main(YouTube.java:15)
    Caused by: 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 ytpack.YouTube.main(YouTube.java:13)
 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

Can someone please tell me what I'm doing wrong?

0 Answers
Related