Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant not work well in java #12773

Closed
Solr007 opened this issue Apr 18, 2017 · 5 comments
Closed

cant not work well in java #12773

Solr007 opened this issue Apr 18, 2017 · 5 comments

Comments

@Solr007
Copy link

@Solr007 Solr007 commented Apr 18, 2017

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();
}
}

public static void  main(String[] args){
    getVideo();
}

}

@Solr007 Solr007 changed the title cant not work well well in java cant not work well in java Apr 18, 2017
@Hrxn
Copy link

@Hrxn Hrxn commented Apr 18, 2017

If it works with youtube-dl, it actually is not really an issue with youtube-dl, maybe?
Ever thought about that?

@Solr007
Copy link
Author

@Solr007 Solr007 commented Apr 18, 2017

the problem is about the block of the subprocess .

@siddht4
Copy link

@siddht4 siddht4 commented Apr 18, 2017

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

@siddht4
Copy link

@siddht4 siddht4 commented Apr 18, 2017

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

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 18, 2017

Carefully read new issue template and provide all requested information.

@dstftw dstftw closed this Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.