JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 25.10.2019, 12:08
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default ffmpeg mp3

Hello I have a question about FFMPEG is possible that when you put a video link jdownloader with the plugin ffmpeg converts it to mp3 directly.
Because for now it downloads the mp4 that I converted with another software.
Can you help me ?
Thank you

Last edited by Jiaz; 25.10.2019 at 12:32.
Reply With Quote
  #2  
Old 25.10.2019, 12:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

See community eventscripter script https://board.jdownloader.org/showthread.php?t=70525
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 25.10.2019, 12:39
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

thank you but we put these commands or that in jdownloader I do not understand
Reply With Quote
  #4  
Old 25.10.2019, 13:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Install Eventscripter, then create new entry ' Trigger required: "A Download Stopped".'
and place the script in it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 25.10.2019, 13:20
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

I download it or please
Reply With Quote
  #6  
Old 25.10.2019, 13:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

In Settings, scroll down and there you can install the Eventscripter extension, then restart, then setup the script as described
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 25.10.2019, 13:56
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

I do not find eventscripter in the left menu sorry I'm bad and I must bother you
Reply With Quote
  #8  
Old 25.10.2019, 16:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

In Settings, scroll to the bottom and there you'll find Eventscripter with a big plus/+
there you can click and install the extension
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 25.10.2019, 16:43
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

what I do not understand is how to download the extension
when I try to paste all the lines in edit scripts it notes me error line # 29 can you help me
Reply With Quote
  #10  
Old 25.10.2019, 16:49
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Please see here for screenshots how to install the eventscripter extension
https://support.jdownloader.org/Know...to-jdownloader
__________________
JD-Dev & Server-Admin
Reply With Quote
  #11  
Old 25.10.2019, 17:11
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

sorry he puts me this error message: missing; before statement (# 2)
I type and paste like that : if (name == "MyButton") {
alert("MyButton pressed"); {
{
and i paste that :
if (link.isFinished()) {
var fileName = link.name.replace(/(.+)(\..+$)/, "$1");
var fileType = link.name.replace(/(.+)(\..+$)/, "$2");
var sourceFile = link.getDownloadPath();
var audioFile = /\.(aac|m4a|ogg)$/.test(sourceFile);

if (audioFile) {
var downloadFolder = package.getDownloadFolder();
var destFile = downloadFolder + "/" + fileName + ".mp3";
var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath");
var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe");
var data = JSON.parse(callSync(ffprobe, "-v", "quiet", "-print_format", "json", "-show_streams", "-show_format", sourceFile));
var streamsBitrate = data.streams[0].bit_rate ? data.streams[0].bit_rate : 0;
var formatBitrate = data.format.bit_rate ? data.format.bit_rate : 0;
var bitrate = Math.max(streamsBitrate, formatBitrate) / 1000;
var deleteSourceFile = false; // Set this to true to delete source file after conversion.

if (bitrate > 0) {
callSync(ffmpeg, "-y", "-i", sourceFile, "-b:a", bitrate + "k", destFile);
if (deleteSourceFile && getPath(destFile).exists()) deleteFile(sourceFile, false);
}
}
}

is that what I need to do
Reply With Quote
  #12  
Old 25.10.2019, 17:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

This script isn't the one from first post?
Your script has error
Quote:
if (name == "MyButton") {
alert("MyButton pressed");
}
In case you want the script to be modified/work differently, best would be to contact mgpai in that thread and ask for help. He's the Script master!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #13  
Old 25.10.2019, 17:37
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

thanks
Reply With Quote
  #14  
Old 25.10.2019, 17:39
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

how do i contact mgpai
Reply With Quote
  #15  
Old 25.10.2019, 17:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

You're welcome
either write him a private message in forum or just write a post in the thread and ask him for help
__________________
JD-Dev & Server-Admin
Reply With Quote
  #16  
Old 25.10.2019, 18:12
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default mgpai to help

mgpai to help
i need for event scriptter in jdownloader 2 i would like to convert to mp3 directly in jdownloader? i asked for help from jiaz he told me to contact you.
Can you help me ?

Last edited by Jiaz; 25.10.2019 at 19:36.
Reply With Quote
  #17  
Old 25.10.2019, 18:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

As reference
https://board.jdownloader.org/showthread.php?t=70525
and
https://board.jdownloader.org/showthread.php?t=81973
__________________
JD-Dev & Server-Admin
Reply With Quote
  #18  
Old 25.10.2019, 18:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

@smokiemamour,
  1. Click 'edit' to open the script editor and create a new script
  2. Clear any contents which are present in the editor
  3. Copy and paste the contents which are in the following "code" box.
  4. Save the script
  5. In the Eventscripter panel, select "A Download Stopped" trigger from the drop down box in the "Trigger" column.
  6. Double-click the field in the 'name' column to specify a name for the script (optional)
  7. Enable the script 'checkbox'
Code:
// Convert aac/m4a/ogg files to mp3.
// Trigger required: "A Download Stopped".
// Requires ffmpeg/ffprobe. Uses JD ffmpeg/ffprobe settings if available.
// Overwrites destination file (mp3) if it already exists.

if (link.isFinished()) {
    var fileName = link.name.replace(/(.+)(\..+$)/, "$1");
    var fileType = link.name.replace(/(.+)(\..+$)/, "$2");
    var sourceFile = link.getDownloadPath();
    var audioFile = /\.(aac|m4a|ogg)$/.test(sourceFile);

    if (audioFile) {
        var downloadFolder = package.getDownloadFolder();
        var destFile = downloadFolder + "/" + fileName + ".mp3";
        var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath");
        var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe");
        var data = JSON.parse(callSync(ffprobe, "-v", "quiet", "-print_format", "json", "-show_streams", "-show_format", sourceFile));
        var streamsBitrate = data.streams[0].bit_rate ? data.streams[0].bit_rate : 0;
        var formatBitrate = data.format.bit_rate ? data.format.bit_rate : 0;
        var bitrate = Math.max(streamsBitrate, formatBitrate) / 1000;
        var deleteSourceFile = false; // Set this to true to delete source file after conversion.

        if (bitrate > 0) {
            callSync(ffmpeg, "-y", "-i", sourceFile, "-b:a", bitrate + "k", destFile);
            if (deleteSourceFile && getPath(destFile).exists()) deleteFile(sourceFile, false);
        }
    }
}

When aac/m4a/ogg file is downloaded, the script will automatically convert it into mp3.

If you are still having problem running the script, you can also contact me in JD Chat:
Code:
webchat.freenode.net//#jdownloader?nick=JD_00?
Reply With Quote
  #19  
Old 25.10.2019, 18:32
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

I copy this in the first link you sent me 'Convert AAC / M4A / OGG files to MP3.' but he puts me an error message : ReferenceError : "link" is not defined (#6)
Reply With Quote
  #20  
Old 25.10.2019, 18:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

You have to use the Trigger "A Download Stopped" !
__________________
JD-Dev & Server-Admin
Reply With Quote
  #21  
Old 25.10.2019, 19:12
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

I made a test I download a video youtube he has downloaded in ogg acc mp4 and a message says this:
the remote API : config/yet. Do you want to allow this ? if you are not sur please check your script
Reply With Quote
  #22  
Old 25.10.2019, 19:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

add new line with
Quote:
disablePermissionChecks();
before if (link...
__________________
JD-Dev & Server-Admin
Reply With Quote
  #23  
Old 25.10.2019, 19:34
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

it's good it works thank you for everything
Reply With Quote
  #24  
Old 25.10.2019, 19:35
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Thanks for the feedback and you're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #25  
Old 25.10.2019, 19:59
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

I forget what file format is it converted to is it possible to sort in linkgrabber?
to only have the file to convert and not all other formats
after I will not begrudge you
Reply With Quote
  #26  
Old 25.10.2019, 20:10
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by smokiemamour View Post
I forget what file format is it converted to is it possible to sort in linkgrabber?
to only have the file to convert and not all other formats
after I will not begrudge you
Any file downloaded in 'aac', 'm4a' or 'ogg' format will be automatically converted to 'mp3' file. If you are looking for something different, feel free to ask.
Reply With Quote
  #27  
Old 25.10.2019, 20:24
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

when i copy the link youtube it goes into linkgrabber, it offers several formats how to automatically remove those that I do not need as jpg webm mp4 txt
Reply With Quote
  #28  
Old 25.10.2019, 20:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by smokiemamour View Post
... how to automatically remove those that I do not need as jpg webm mp4 txt
For youtube, you can customize it in: Settings > Plugins > youtube.com
Reply With Quote
  #29  
Old 25.10.2019, 20:27
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

See Settings-Plugins-search for youtube and scroll down, there you can deselect unwanted groups
__________________
JD-Dev & Server-Admin
Reply With Quote
  #30  
Old 25.10.2019, 21:04
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

thanks for all that works fine
Reply With Quote
  #31  
Old 29.10.2019, 10:24
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

hello how can i know that the create button works?
Jdownloader gives me an error message:
Syntaxerror: unterminated object literal (#17)

Can you help me?
Thank you
Reply With Quote
  #32  
Old 29.10.2019, 11:46
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Can you please provide the script? That error looks like error in script.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #33  
Old 29.10.2019, 11:57
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

Code:
// Convert aac/m4a/ogg files to mp3.
// Trigger required: "A Download Stopped".
// Requires ffmpeg/ffprobe. Uses JD ffmpeg/ffprobe settings if available.
// Overwrites destination file (mp3) if it already exists.

if (link.isFinished()) {
    var fileName = link.name.replace(/(.+)(\..+$)/, "$1");
    var fileType = link.name.replace(/(.+)(\..+$)/, "$2");
    var sourceFile = link.getDownloadPath();
    var audioFile = /\.(aac|m4a|ogg)$/.test(sourceFile);

    if (audioFile) {
        var downloadFolder = package.getDownloadFolder();
        var destFile = downloadFolder + "/" + fileName + ".mp3";
        var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath");
        var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe");
        var data = JSON.parse(callSync(ffprobe, "-v", "quiet", "-print_format", "json", "-show_streams", "-show_format", sourceFile));
        var streamsBitrate = data.streams[0].bit_rate ? data.streams[0].bit_rate : 0;
        var formatBitrate = data.format.bit_rate ? data.format.bit_rate : 0;
        var bitrate = Math.max(streamsBitrate, formatBitrate) / 1000;
        var deleteSourceFile = false; // Set this to true to delete source file after conversion.

        if (bitrate > 0) {
            callSync(ffmpeg, "-y", "-i", sourceFile, "-b:a", bitrate + "k", destFile);
            if (deleteSourceFile && getPath(destFile).exists()) deleteFile(sourceFile, false);
        }
    }
}
disablePermissionChecks();

Last edited by raztoki; 03.12.2019 at 13:06.
Reply With Quote
  #34  
Old 29.10.2019, 12:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

does this happen every time or randomly?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #35  
Old 29.10.2019, 12:33
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

every time
Reply With Quote
  #36  
Old 29.10.2019, 12:33
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

Sorry I made a mistake randomly
Reply With Quote
  #37  
Old 29.10.2019, 12:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Thanks for the feedback! Then I already have an idea where this happens
__________________
JD-Dev & Server-Admin
Reply With Quote
  #38  
Old 29.10.2019, 13:00
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

what should i do click here?
it appears in larger I do not understand.
little extra question: when I download youtebe songs in the file explorer it puts me a lot of sub folders is it possible that jdownloader put the file in bulk
Reply With Quote
  #39  
Old 29.10.2019, 13:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

You've got to wait till I found/fixed that bug causing the issue you're reported
To disable the subfolders, see https://support.jdownloader.org/Know...ackage-feature
Please know that changing this will only affect new added links!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #40  
Old 06.11.2019, 15:14
smokiemamour smokiemamour is offline
JD Beta
 
Join Date: Sep 2019
Posts: 55
Default

hello, do you have news for the script?
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 20:02.
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.