diff options
| author | Pinapelz <yukais@pinapelz.com> | 2023-12-23 20:01:08 -0800 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2023-12-23 20:01:08 -0800 |
| commit | b133b62d056fa15c407d538f4a8f5fe1406a144b (patch) | |
| tree | d851119a141e3616e190f5487f74999652cfa67c | |
| parent | fdd19f2d8bd451bc184b576de42eef0376bf736a (diff) | |
chore: ensure webm ext is always used
| -rw-r--r-- | src/main/java/Downloader.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/Downloader.java b/src/main/java/Downloader.java index 4f01108..b3087fc 100644 --- a/src/main/java/Downloader.java +++ b/src/main/java/Downloader.java @@ -152,6 +152,7 @@ public class Downloader { oldFile.renameTo(newFile); } tagMp3InDir(uploader, title, imageUrl, outputDirectory); + fileUtil.deleteFile(downloadedWebm.getAbsolutePath()); fileUtil.deleteFile(fileUtil.findJsonFile(outputDirectory)); File downloadedMp3 = fileUtil.findFileWithType(outputDirectory, "mp3"); downloadedMp3.renameTo(new File(outputDirectory+"/"+downloadedMp3.getName())); @@ -161,7 +162,7 @@ public class Downloader { public boolean download(String url){ String ytDlpExecutable = "yt-dlp" + (System.getProperty("os.name").startsWith("Windows") ? ".exe" : ""); try { - String[] command = {ytDlpExecutable, "-f", "ba", "-x", "--audio-format", "mp3", "--write-info-json", url, "-o", "%(title)s[%(id)s].%(ext)s"}; + String[] command = {ytDlpExecutable, "-f", "bestaudio[ext=webm]", "-x", "--audio-format", "mp3", "--write-info-json", url, "-o", "%(title)s[%(id)s].%(ext)s"}; ProcessBuilder processBuilder = new ProcessBuilder(command); processBuilder.directory(new File(outputDirectory)); Process process = processBuilder.start(); |
