Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cant not work well in java #12773
cant not work well in java #12773
Comments
|
If it works with youtube-dl, it actually is not really an issue with youtube-dl, maybe? |
|
the problem is about the block of the subprocess . |
|
usually the output is retrieved when the python / youtube-dl process ends . so the error here is that you are not patience , if its more than a 500 mb of file it will take its own time , just give it that much time to work |
|
think it this way java ------> jvm ----> exec python -----> youtube-dl (python ) -----> ffmpeg (if required) ---> exec python ends ------> back to jvm ------> java i.e your code |
|
Carefully read new issue template and provide all requested information. |
I want to download the video in twitter, but when execute the code, if the video is so big ,the video can not download ,just as xxxxxxxx.mp4.part, where is the error in my code.
public class Video {
public static void getVideo(){
String path = "C:\Users\mgr001\Desktop\1\youtube-dl.exe -o";
String commandPrf = "cmd /c " + path +"C:\Users\mgr001\Desktop\%(id)s.%(ext)s";
//String url ="pic.twitter.com/B2NQzj53ft";
String url = "pic.twitter.com/8KGFSk8BFj";
String Command = commandPrf + " " + url;
Runtime rt = Runtime.getRuntime();
Process ps = null;
try {
ps = rt.exec(Command);
ps.waitFor();
System.out.println("Successful");
}catch (Exception e){
System.out.println("Failure");
}finally {
ps.destroy();
}
}
}