#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
See community eventscripter script https://board.jdownloader.org/showthread.php?t=70525
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
thank you but we put these commands or that in jdownloader I do not understand
|
#4
|
||||
|
||||
Install Eventscripter, then create new entry ' Trigger required: "A Download Stopped".'
and place the script in it
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
I download it or please
|
#6
|
||||
|
||||
In Settings, scroll down and there you can install the Eventscripter extension, then restart, then setup the script as described
__________________
JD-Dev & Server-Admin |
#7
|
|||
|
|||
I do not find eventscripter in the left menu sorry I'm bad and I must bother you
|
#8
|
||||
|
||||
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 |
#9
|
|||
|
|||
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 |
#10
|
||||
|
||||
Please see here for screenshots how to install the eventscripter extension
https://support.jdownloader.org/Know...to-jdownloader
__________________
JD-Dev & Server-Admin |
#11
|
|||
|
|||
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 |
#12
|
||||
|
||||
This script isn't the one from first post?
Your script has error Quote:
__________________
JD-Dev & Server-Admin |
#13
|
|||
|
|||
thanks
|
#14
|
|||
|
|||
how do i contact mgpai
|
#15
|
||||
|
||||
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 |
#16
|
|||
|
|||
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. |
#17
|
||||
|
||||
As reference
https://board.jdownloader.org/showthread.php?t=70525 and https://board.jdownloader.org/showthread.php?t=81973
__________________
JD-Dev & Server-Admin |
#18
|
|||
|
|||
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)
|
#19
|
||||
|
||||
You have to use the Trigger "A Download Stopped" !
__________________
JD-Dev & Server-Admin |
#20
|
|||
|
|||
@smokiemamour,
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? |
Thread Tools | |
Display Modes | |
|
|