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,508
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,508
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
  #3005  
Old 21.07.2024, 11:23
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 701
Default Worked fine, now I get "Security Violation errors"

Quote:
Originally Posted by mgpai View Post
Code:
/*
    generate "video_duration_comma" property
    trigger : packagizer hook
    Enable "synchronous execution of script" checkbox in top panel
*/    

if (linkcheckDone && state == "BEFORE") {
    var duration = link.getProperty("video_duration");

    if (duration != null) {
        link.setProperty("video_duration_comma", duration.toString().replace(".",","));
    }
}
Until yesterday (July 20) this script worked fine for me. But now sometimes(!) I'm getting below error message.



When it appeared for the first time, I could click on error details (see below) and I could click on OK, so that JD continued grabbing.

Today it appeared again, but this time I had to end the JD process in TaskManager. No reaction on any mouse clicks. It must have something to do with the files I'm grabbing, because when I add a block of links to "Analyze and add links"-window and click on continue, a couple of links are being grabbed and then the error message pops up.

Reproducible, as often as I like...

Maybe a JD update could (also) have something to do with it. Because for two weeks of intensive use, this error never occurred.

Any ideas?

Thanks for any help provided in advance!


Code:
net.sourceforge.htmlunit.corejs.javascript.EcmaError: Security Violation: Security Violation java.lang.Short (#8)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3935)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3919)
	at org.jdownloader.extensions.eventscripter.ScriptThread.isClassVisibleToScript(ScriptThread.java:505)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory$2.visibleToScripts(JSHtmlUnitPermissionRestricter.java:180)
	at net.sourceforge.htmlunit.corejs.javascript.JavaMembers.<init>(JavaMembers.java:31)
	at net.sourceforge.htmlunit.corejs.javascript.JavaMembers.lookupClass(JavaMembers.java:785)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaObject.initMembers(NativeJavaObject.java:53)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaObject.<init>(NativeJavaObject.java:43)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaObject.<init>(NativeJavaObject.java:34)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxNativeJavaObject.<init>(JSHtmlUnitPermissionRestricter.java:295)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxWrapFactory.wrapAsJavaObject(JSHtmlUnitPermissionRestricter.java:287)
	at net.sourceforge.htmlunit.corejs.javascript.WrapFactory.wrap(WrapFactory.java:72)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxWrapFactory.wrap(JSHtmlUnitPermissionRestricter.java:266)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:222)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536)
	at script(:8)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:134)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3286)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
	at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1361)
	at org.jdownloader.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:346)
	at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:194)
	at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:169)

Last edited by StefanM; 21.07.2024 at 11:36.
Reply With Quote
  #3006  
Old 21.07.2024, 12:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,508
Default

@StefanM: Thanks for the report, will be fixed with next update later today
optimization of json parser that reduces memory consumption is causing this
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3007  
Old 21.07.2024, 12:53
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 701
Default

Quote:
Originally Posted by Jiaz View Post
@StefanM: Thanks for the report, will be fixed with next update later today
optimization of json parser that reduces memory consumption is causing this
Thanks for the prompt reply and reaction.
Reply With Quote
  #3008  
Old 22.07.2024, 16:23
senormal senormal is offline
Baby Loader
 
Join Date: Mar 2024
Posts: 7
Default Parse comments for links

Hello!
I am trying to create a little script that adds the entire content of a comment to the linkgrabber function: my hope is that the links within the comment will be automatically parsed and added to the hit list while conserving the save folder parameters of the link that had the comment.
Would it be possible for me to get help with this? I have asked copilot but the script is not working... Would there be a way to enable this only for certain domains/hosters?


Code:
for (var i = 0; i < package.getChildren().length; i++) {
    var hit = package.getChildren()[i];
    if (hit.getComment() && hit.getComment().length > 0) {
        var comment = hit.getComment();
        linkCollector.addURL(url);
        }
    }
}
Thank you kindly!
Reply With Quote
  #3009  
Old 22.07.2024, 16:24
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,105
Default

Context regarding the post of user "senormal":
https://board.jdownloader.org/showthread.php?t=96066
__________________
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
  #3010  
Old 22.07.2024, 17:36
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,508
Default

Quote:
Originally Posted by Jiaz View Post
@StefanM: Thanks for the report, will be fixed with next update later today
optimization of json parser that reduces memory consumption is causing this
Update is released
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3011  
Old 22.07.2024, 18:24
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 701
Default

Quote:
Originally Posted by Jiaz View Post
Update is released

Fehler!


Tja, jetzt werden bei mir Links gar nicht mehr gefunden.
Getestet mit k2s und mit wetransfer.

Wohl aber mit der vorherigen Version, die ich als BAK gesichert hatte.

EDIT

Should have written in English:

Error!
JD doesn't find links anymore!
Tested with k2s and wetransfer.

Previous JD version (from Sunday), however, restored from a backup, still finds those links.

Last edited by StefanM; 22.07.2024 at 18:35.
Reply With Quote
  #3012  
Old 22.07.2024, 18:48
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,105
Default

Quote:
Originally Posted by StefanM View Post
Tja, jetzt werden bei mir Links gar nicht mehr gefunden.
Das Problem wurde hier bereits gemeldet.

Bitte abonniere den verlinkten Thread, um über einen Bugfix informiert zu werden.
__________________
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
  #3013  
Old 22.07.2024, 19:07
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 701
Default

Quote:
Originally Posted by Jiaz View Post
@StefanM: Thanks for the report, will be fixed with next update later today
optimization of json parser that reduces memory consumption is causing this
Last update (18:53 German DST) seems to have cured the original problem.
Four tests with a larger number of links and the script enabled could not provoke the error (freezing,...) anymore.

But as I will continue using that script on a daily basis, there will be more reliable test results pretty soon.
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 01:22.
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.