I've tried executing youtube-dl from Java using Runtime.getRuntime().exec("youtube.dl url") but I've quickly realised its a lot more complicated! There are several programs on github where coders are developing programs to execute youtube-dl from Java, which would be the best for me to go with? Any help or advice would be useful. Thanks.
The youtubedl-java Github project might work for you. As of Dec 2021, it looks abandoned, but the lastest version works for me.
<dependency>
<groupId>com.github.sapher</groupId>
<artifactId>youtubedl-java</artifactId>
<!-- latests release version -->
<!-- version>1.1</version -->
<version>2cbe41f</version> <!-- i use latest commit to get callback interface class -->
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With