aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2023-12-23 20:01:08 -0800
committerPinapelz <yukais@pinapelz.com>2023-12-23 20:01:08 -0800
commitb133b62d056fa15c407d538f4a8f5fe1406a144b (patch)
treed851119a141e3616e190f5487f74999652cfa67c /src/main
parentfdd19f2d8bd451bc184b576de42eef0376bf736a (diff)
chore: ensure webm ext is always used
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/Downloader.java3
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();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage