JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11.03.2021, 13:48
Tom Tom is offline
JD Adviser
 
Join Date: Jun 2018
Posts: 104
Default event script geht nicht mehr

Hallo,

seit 2,3 Tagen geht das Eventscript nicht mehr.

11.03.21 12.44.35 <--> 11.03.21 12.45.35 jdlog://5968725302851/

Code:
// Convert dts to ac3 and create new video file
// Trigger Required: A new file has been created
// Forum Topic: https://board.jdownloader.org/showpo...&postcount=489

var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath");
var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe");

files.forEach(function(file) {
    if (["mkv"].indexOf(getPath(file).getExtension()) == -1) return;
    var meta = callSync(ffprobe, "-i", file);
    var ac3 = meta.indexOf("(ger): Audio: ac3") > -1;
    var dts = meta.indexOf("(ger): Audio: dts") > -1;
    var eac3 = meta.indexOf("(ger): Audio: eac3") > -1;
        
    if (ac3 || dts || eac3) {
        var ext = getPath(file).getExtension();
        var ac3Command = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:v", "copy", "-c:s", "copy", "2>", "/d:/download/out.txt", file.replace(ext, "_ac3." + ext)];
        var eac3Command = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:v", "copy", "-c:s", "copy", "2>", "/d:/download/out.txt", file.replace(ext, "_ac3." + ext)];
        var dtsCommand = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:v", "copy", "-c:s", "copy", "-c:a", "ac3", "-b:a", "640k", "2>", "/d:/download/out.txt", file.replace(ext, "_ac3." + ext)];

        callAsync(function(error) {
            if (!error) getPath(file).delete();
        }, ac3 ? ac3Command : dtsCommand);
    }
});

Eine Idee warum es nicht mehr tut?

Gruß,
Tom
Reply With Quote
  #2  
Old 11.03.2021, 14:46
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,918
Default

Hi,
ist dein Script aktiv?
Ist der Trigger noch korrekt?
Bitte füge einige der folgenden Zeilen an verschiedenen Stellen deines Scripts hinzu, damit man im Log sehen kann, "wie weit es kommt":
Code:
log("DeinLogText")
Grüße, psp
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #3  
Old 11.03.2021, 14:56
Tom Tom is offline
JD Adviser
 
Join Date: Jun 2018
Posts: 104
Default

Hey,

ja Script ist aktiv und den Trigger gibt es (Eine neue Datei wurde erstellt).
Hab mal paar log-Zeilen eingefügt und ne Datei runtergeladen:
11.03.21 13.14.59 <--> 11.03.21 13.53.47 jdlog://6968725302851/
Reply With Quote
  #4  
Old 11.03.2021, 16:05
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,918
Default

Schick uns mal bitte die folgende Datei an support@jdownloader.org:
Code:
D:\JDownloader 2.0\cfg\org.jdownloader.extensions.schedulerV2.SchedulerExtension.entrylist.json
Lösche sie danach bei dir und starte JD neu.

Grüße, psp
EDIT

Zeig mal bitte dein Script mit den Log-Ausgaben.
Bitte auch in den "foreach" Teil Log-Ausgaben einfügen.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?

Last edited by pspzockerscene; 11.03.2021 at 16:12.
Reply With Quote
  #5  
Old 11.03.2021, 16:44
Tom Tom is offline
JD Adviser
 
Join Date: Jun 2018
Posts: 104
Default

ok, hat nix gebracht.

hier mit log
Code:
var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath");
log("DeinLogText")
var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe");
log("DeinLogText")

files.forEach(function(file) {
    if (["mkv"].indexOf(getPath(file).getExtension()) == -1) return;
    log("DeinLogText")
    var meta = callSync(ffprobe, "-i", file);
    log("DeinLogText")
    var ac3 = meta.indexOf("(ger): Audio: ac3") > -1;
    log("DeinLogText")
    var dts = meta.indexOf("(ger): Audio: dts") > -1;
    var eac3 = meta.indexOf("(ger): Audio: eac3") > -1;
        
    if (ac3 || dts || eac3) {
        var ext = getPath(file).getExtension();
        var ac3Command = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:v", "copy", "-c:s", "copy", "2>", "/d:/download/out.txt", file.replace(ext, "_ac3." + ext)];
	log("DeinLogText")
        var eac3Command = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:v", "copy", "-c:s", "copy", "2>", "/d:/download/out.txt", file.replace(ext, "_ac3." + ext)];
        var dtsCommand = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:v", "copy", "-c:s", "copy", "-c:a", "ac3", "-b:a", "640k", "2>", "/d:/download/out.txt", 
	log("DeinLogText")
file.replace(ext, "_ac3." + ext)];

        callAsync(function(error) {
            if (!error) getPath(file).delete();
        }, ac3 ? ac3Command : dtsCommand);
    }
});
Reply With Quote
  #6  
Old 11.03.2021, 19:07
Tom Tom is offline
JD Adviser
 
Join Date: Jun 2018
Posts: 104
Default

war gerade mit mgpai im chat und er hat kleine Änderungen gemacht.
keine Ahnung was der Grund war, aber jetzt tut wieder alles :-D

Code:
files.forEach(function(file) {
    if (getPath(file).extension == "mkv") {
        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 stream = function(stream) {
            var meta = callSync(ffprobe, "-i", file);
            return meta.indexOf(stream) > -1;
        }
        var command, ext = getPath(file).getExtension();

        stream("(ger): Audio: ac3") && (command = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:a", "copy", "-c:v", "copy", "-c:s", "copy", file.replace(ext, "_ac3." + ext)]);
        stream("(ger): Audio: dts") && (command = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:v", "copy", "-c:s", "copy", "-c:a", "ac3", "-b:a", "640k", file.replace(ext, "_ac3." + ext)]);
        stream("(ger): Audio: eac3") && (command = [ffmpeg, "-i", file, "-map", "0:v", "-map", "0:m:language:ger", "-c:a", "copy", "-c:v", "copy", "-c:s", "copy", file.replace(ext, "_ac3." + ext)]);

        command && callAsync(function(x) {
            !x && getPath(file).delete();
        }, command);
    }
});
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 13:56.
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.