JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #3001  
Old 06.07.2024, 21:51
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,384
Default

@dataDyne: Your script is missing closing
Quote:
}
tags add another } at the end
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3002  
Old 07.07.2024, 00:23
dataDyne's Avatar
dataDyne dataDyne is offline
Baby Loader
 
Join Date: Mar 2024
Posts: 8
Lightbulb

Yes, work and without errors, but I want with the option automatically delete all original files...any help for this?
This is a working script for convert all audio files to MP3 320Kbps, but I want with erase the original files:
EDIT: 100% working script for convert all audio files (YouTube, etc...) to MP3 320Kbps and automatically delete all original files:
Code:
/*
    Convert aac/m4a/ogg/opus files to 320 kbps mp3.
    Trigger required: "A Download Stopped".
*/

if (link.finished) {
    var input = link.downloadPath;
    var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg|opus)$/i, "$1mp3");

    if (input != output) {
        var interfaceName = "org.jdownloader.controlling.ffmpeg.FFmpegSetup";
        var ffmpeg = callAPI("config", "get", interfaceName, null, "binarypath");

        callSync(ffmpeg, "-n", "-i", input, "-b:a", "320k", output);
        getPath(output).size && getPath(input).delete();
    }
}

Last edited by dataDyne; 07.07.2024 at 03:52.
Reply With Quote
  #3003  
Old 07.07.2024, 00:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,384
Default

@dataDyne: the script already has the deleting part in it
Quote:
getPath(output).size && getPath(input).delete();
when output(mp3) exists, it should delete the original file
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3004  
Old 07.07.2024, 03:49
dataDyne's Avatar
dataDyne dataDyne is offline
Baby Loader
 
Join Date: Mar 2024
Posts: 8
Default

YES! Now work correctly...and delete all original audio files.
Thank you so much!...have a nice day!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 14:26.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.