JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2841  
Old 27.03.2024, 17:30
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,951
Default

@hideas

Looking into my dev-tools, missav.com does not use the "Origin" header for its oqn reuqests.
It is only used when you play the video and their CDN host "surrit.com" is accessed.
__________________
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
  #2842  
Old 28.03.2024, 03:11
hideas hideas is offline
Vacuum Cleaner
 
Join Date: Feb 2024
Posts: 17
Default

@pspzockerscene you are most likely right, and I should elaborate:

I do not know very well the workings behind headers and requests, All my script did is when url containing **External links are only visible to Support Staff****External links are only visible to Support Staff** is copied to clipboard, it tries to search page source, and add the m3u8 to the linkgrabber list, which was the CDN host link, which was getting blocked by the cloudflare.

now, when i used myBrowser.setHeader(Origin, "**External links are only visible to Support Staff**); I could use the same browser object within the script to display the content of the CDN link m3u8 (successfully shows HLS format 0001.ts 0002.ts 0003.ts whatever etc). If I dont use those headers, it gets blocked 403 when I try to display content. so that is how I knew the Origin header was the one I needed to pass to the browser/API/whatever. That is all i know regarding the headers.

Last edited by hideas; 28.03.2024 at 03:18.
Reply With Quote
  #2843  
Old 28.03.2024, 14:38
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,951
Default

The problem is that whenever the plugin-system would work solely with those ".m3u8" URLs again, it does not know anything about those headers needed to get around Cloudflare so your attempt was doomed to fail.

For this to work, you'd need to be able to set specific headers and/or cookies on all URLs you are returning to the plugin system to tell it "please use those headers".
Afaik this isn't possible yet.
__________________
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
  #2844  
Old 28.03.2024, 17:29
hideas hideas is offline
Vacuum Cleaner
 
Join Date: Feb 2024
Posts: 17
Default

yup and sure enough I was not able to complete the script to working condition.
I used calling yt-dlp as a workaround because that one does seem to have such function(--add-headers), but you updated the JD plugin to have quality selection so I can just use that now. thanks again for that.
In any case, for me was good to try to make my own fixes just for fun and to learn stuff.
Reply With Quote
  #2845  
Old 28.03.2024, 17:32
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,951
Default

Thanks for your feedback and yes, when it comes to settings on such a level, yt-dlp is prividng more flexibility.

Keep in mind that the current plugin is still a shaky thing:
It only needs one factor such as Cloudflare kicking in to make it fail^^
Have a nice easter
__________________
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
  #2846  
Old 28.03.2024, 23:13
hideas hideas is offline
Vacuum Cleaner
 
Join Date: Feb 2024
Posts: 17
Default

I Hope that site managers stay sleepy ;P
Will do, you too!
Reply With Quote
  #2847  
Old 01.04.2024, 14:19
dataDyne's Avatar
dataDyne dataDyne is offline
Baby Loader
 
Join Date: Mar 2024
Posts: 8
Exclamation REQUEST: 100% Working script for convert all YT audio files to MP3 320 Kbps bitrate

This script work for all audio files but only in MP3 128 Kbps:
Alternate version (2021.11.04)
https://board.jdownloader.org/showpo...61&postcount=1
With the Trigger in Event Scripter activated "A Download stopped", and automatically delete all original files.

Here is the script for convert YT audio files to MP3 320 Kbps bitrate, works correctly but not for all files:
https://board.jdownloader.org/showpo...postcount=1654

Look, in the MP3 128 Kbps option has this line of text:
var output = input.replace(/(aac|m4a|ogg|opus)$/, "mp3");
In the other script for MP3 320 Kbps all the words are written, but the text |opus is missing:
var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg)$/i, "$1mp3");

I believe that exists something wrong with this text, opus audio files, any help for 100% working script?

Last edited by dataDyne; 01.04.2024 at 14:40.
Reply With Quote
  #2848  
Old 01.04.2024, 15:31
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by dataDyne View Post
...works correctly but not for all files...
Try replacing:
Code:
var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg)$/i, "$1mp3");
with:
Code:
var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg|opus)$/i, "$1mp3");
Reply With Quote
  #2849  
Old 04.04.2024, 14:38
thomaz thomaz is offline
Fibre Channel User
 
Join Date: Sep 2009
Posts: 116
Default

Quote:
Originally Posted by Crank436 View Post
Hey!
Maybe you can help me, im new to this scripting stuff.
I'm trying to write a script, to always have a specific amount of time between two reconnects.
I have one script "after each reconnect" which should safe the current time.
Another script "before each reconnect" which checks, if the time since the last reconnect is < x, and if not it waits until its < x (e.g. 90s).

Now my problem: I cant access the variable from the first script in the second one. How can I make this global? I read that its global in Javascript, if its not inside a function. It isnt, its just
now = new Date()

Sorry, I'm really a total new to this...
I need a fully working Script too.
Anybody can help me?

A Script which allows a Reconnect only every x Minutes.

"If last reconnect is shorter than 5 minutes then delay reconnect to match 5 minutes"

Last edited by thomaz; 04.04.2024 at 21:24.
Reply With Quote
  #2850  
Old 08.04.2024, 12:31
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by thomaz View Post
I need a fully working Script too.
Anybody can help me?

A Script which allows a Reconnect only every x Minutes.

"If last reconnect is shorter than 5 minutes then delay reconnect to match 5 minutes"
Code:
/*
    trigger : before a reconnect
*/

var next = getProperty("next", true);

while (Date.now() < next) {
    sleep(1000);
}
Code:
/*
    trigger : after a reconnect
*/

var x = 5 // <- wait time in minuites
var next = Date.now() + x * 60000;

setProperty("next", next, true);
Reply With Quote
  #2851  
Old 08.04.2024, 12:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@mgpai: I would recommend following, "after reconnect" , store global property timestamp and disable auto reconnect , and interval script that checks for timestamp and after timeout, remove property and enable auto reconnect.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2852  
Old 08.04.2024, 12:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: I would recommend following, "after reconnect" , store global property timestamp and disable auto reconnect , and interval script that checks for timestamp and after timeout, remove property and enable auto reconnect.
Had considered it. If JD is closed/restarted while 'auto-reconnect' is disabled, the 'property' will be lost and auto-reonncect will remain disabled after the restart. The user will then have to remember to manually enable it again.
Reply With Quote
  #2853  
Old 08.04.2024, 12:54
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,951
Default

But all users using this script want auto reconnect to be enabled in general so maybe [optionally] always enable it if the property does not exist (?)
__________________
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
  #2854  
Old 08.04.2024, 12:57
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by pspzockerscene View Post
But all users using this script want auto reconnect to be enabled in general so maybe [optionally] always enable it if the property does not exist (?)
:)
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2855  
Old 08.04.2024, 13:10
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by pspzockerscene View Post
But all users using this script want auto reconnect to be enabled in general so maybe [optionally] always enable it if the property does not exist (?)
If I am correct, if auto-reconnect it is disabled globally at startup, niether of the reconnect events will be triggered, which would mean a 3rd script with 'jdownloader started' trigger should be executed just to check/enable auto-reconnect property.

I don't really see any advantage in this method or disadvantage in the current solution. But if you/Jiaz feel otherwise I will gladly implement it.
Reply With Quote
  #2856  
Old 08.04.2024, 13:12
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,951
Default

Quote:
Originally Posted by mgpai View Post
I don't really see any advantage in this method or disadvantage in the current solution. But if you/Jiaz feel otherwise I will gladly implement it.
Nah I don't mind - it's the user who wants that script. I'd wait for his feedback.
__________________
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
  #2857  
Old 08.04.2024, 13:16
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: I would recommend following, "after reconnect" , store global property timestamp and disable auto reconnect , and interval script that checks for timestamp and after timeout, remove property and enable auto reconnect.
For this method no need for 2nd interval script.

After reconnect > disable auto-reconnect > sleep x seconds > re-enable auto-reconnect.
Reply With Quote
  #2858  
Old 08.04.2024, 13:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: I would recommend following, "after reconnect" , store global property timestamp and disable auto reconnect , and interval script that checks for timestamp and after timeout, remove property and enable auto reconnect.
Code:
/*
    trigger : after a reconnect
*/

var x = 5; // <- wait time in minutes
var setAutoReconnectEnabled = function(boolean) {
    callAPI("config", "set", "jd.controlling.reconnect.ReconnectConfig", null, "AutoReconnectEnabled", boolean);
}

setAutoReconnectEnabled(false);
sleep(x * 60000);
setAutoReconnectEnabled(true);

Code:
/*
    trigger : jdownloader started
*/

callAPI("config", "set", "jd.controlling.reconnect.ReconnectConfig", null, "AutoReconnectEnabled", true);
Reply With Quote
  #2859  
Old 08.04.2024, 15:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@mgpai: Thanks for the nice solution!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2860  
Old 09.04.2024, 13:44
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
I could provide api methods for this
Formal request for the APIs.
Reply With Quote
  #2861  
Old 09.04.2024, 15:37
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@mgpai: please send mail to support@jdownloader.org so we can discuss about this api and what it should be capable of
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2862  
Old 09.04.2024, 15:50
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,591
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: please send mail to support@jdownloader.org so we can discuss about this api and what it should be capable of
Will do. Thanks.
Reply With Quote
  #2863  
Old 10.04.2024, 23:10
thomaz thomaz is offline
Fibre Channel User
 
Join Date: Sep 2009
Posts: 116
Default

thx a lot.
this is what im using atm.
had to insert a stop and startDownloads because, when autoreconnect got disabled after a reconnect, the files still had the 1hr timer running down and didnt start to download.

Code:
/*
    trigger : after a reconnect
*/

var x = 4; // <- wait time in minutes
var setAutoReconnectEnabled = function(boolean) {
    callAPI("config", "set", "jd.controlling.reconnect.ReconnectConfig", null, "AutoReconnectEnabled", boolean);
}

setAutoReconnectEnabled(false);
stopDownloads();
sleep(5000);
startDownloads();
sleep(x * 60000);
setAutoReconnectEnabled(true);

Last edited by thomaz; 10.04.2024 at 23:13.
Reply With Quote
  #2864  
Old 11.04.2024, 10:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@thomaz: Thanks fot the feedback and for sharing your script
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2865  
Old 11.04.2024, 10:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by thomaz View Post
had to insert a stop and startDownloads because, when autoreconnect got disabled after a reconnect, the files still had the 1hr timer running down and didnt start to download.
Can you please explain this little further? after a reconnect, every file that has waiting time should be auto reset and not continue to wait.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2866  
Old 11.04.2024, 14:26
thomaz thomaz is offline
Fibre Channel User
 
Join Date: Sep 2009
Posts: 116
Default

The Script disables "AutoReconnect" and due to this the timer still runs down although a reconnect was done.
I then have to "STOP" and "START" again manually.

Video:
**External links are only visible to Support Staff**...
youtube.com/watch?v=wrbIoH8_m4w
I enable AutoReconnect.
Reconnect runs.
After succsessful reconnect the script unchecks "AutoReconnect".
The download wait timer still runs down.
Have to do a "STOP" und "START" manually.

OFFTOPIC: During 1fichier download i have high usage on 1 thread. What does 1fichier do there? Mining? When my cpu is throttled down to 800mhz i only get 2mb/s in free mode, instead of 5mb/s.

Last edited by thomaz; 11.04.2024 at 14:41.
Reply With Quote
  #2867  
Old 11.04.2024, 15:51
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,951
Default

Quote:
Originally Posted by thomaz View Post
OFFTOPIC: During 1fichier download i have high usage on 1 thread. What does 1fichier do there? Mining?
Please read:
https://support.jdownloader.org/de/k...ng-downloading

--> Hint: The 1fichier plugin has a "Prefer https" setting.
__________________
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
  #2868  
Old 11.04.2024, 19:07
thomaz thomaz is offline
Fibre Channel User
 
Join Date: Sep 2009
Posts: 116
Default

Ahhh ... totally forgot ... ecryption. *disable*
thx a lot

EDIT: Disabled it, but it continues using https. maybe the hoster is https only?
No matter, now i know where the cpu usage comes from. always thought the sites are mining or smthg like that.

Otherwise mining for faster free ddls.
How a bout that? ... *RapidgatorCeoAskFeatureRequest*

Last edited by thomaz; 11.04.2024 at 19:25.
Reply With Quote
  #2869  
Old 11.04.2024, 20:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@thomaz: what cpu do you have? does it support aes-ni hardware acceleration? what java version do you use with JDownloader, check about dialog? maybe you can switch to newer version and benefit from performance optimization in aes gcm cipher that has performance hog bug in older java version.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2870  
Old 12.04.2024, 11:57
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,951
Default

@thomaz
Regarding enforcing http/https:
Rapidgator.net: No idea

1fichier.com: They additionally have a dedicated setting for this on their website, see 1fichier.com/console/params.pl -> Force the downloads without SSL
__________________
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
  #2871  
Old 13.04.2024, 22:23
thomaz thomaz is offline
Fibre Channel User
 
Join Date: Sep 2009
Posts: 116
Default

What is the latest jre?
java.com says: jre-8u401-windows-x64.exe
oracle.com says: java from 17 to 23.

cpu is core i3-6100 and i7-6700

Any way to extract jre without installing it?
Tried uniextract... no go
Tried sandboxie... also no :(

Last edited by thomaz; 13.04.2024 at 22:28.
Reply With Quote
  #2872  
Old 13.04.2024, 22:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@thomaz: get jdk/jre from here adoptium.net/de/temurin/releases/?os=windows&arch=x64&package=jre
and then replace the jre/java (don't know right now which one it is) folder within your JDownloader directory. Launcher will first check this folder and then lookup jre in your OS.
Java8,11,17,21 are LTS, will get long term support/updates, but in the end, doesn't really matter. you can still use Java8 or check out Java 21.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2873  
Old 13.04.2024, 22:58
thomaz thomaz is offline
Fibre Channel User
 
Join Date: Sep 2009
Posts: 116
Default

after updating sandboxie i was able to get the jre folder from 8u401-windows-x64.exe.
and ... cpu usage went from ~15% old jre to 1-3% (i3-6100) new jre.
thats very nice. thx

Last edited by thomaz; 13.04.2024 at 23:01.
Reply With Quote
  #2874  
Old 13.04.2024, 23:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

Quote:
Originally Posted by thomaz View Post
after updating sandboxie i was able to get the jre folder from 8u401-windows-x64.exe.
and ... cpu usage went from ~15% old jre to 1-3% (i3-6100) new jre.
thats very nice. thx
Thanks for the feedback. There had been very long time performance bug in aes gcm cipher in java that was causing high cpu usage.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2875  
Old 14.04.2024, 12:31
wizhack wizhack is offline
Baby Loader
 
Join Date: Apr 2024
Posts: 6
Default

Hello i would like to make an event script which move (i dont want to download directly in those folders because i use ssd's for caching downloads) folders when package is finished with that specs:
if package contain *s??e??* move to /mnt/TV
if package contain *2160* or *4K* move to /mnt/4K
if package contain *1080* move to /mnt/HD

I try to make it with a script.sh but the event scripter dont find the script even if i copy the script in /config with docker cp command. here is the event script for test

Code:
var move4k = '/config/scripts/move4k.sh'
callSync(move4k);
and the shell script
Code:
#!/bin/bash
mv /home/user/jdownloader/Downloads/*2160* /mnt/4K/
the log
Spoiler:
net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped org.jdownloader.extensions.eventscripter.EnvironmentException: Line 3
java.io.IOException: Cannot run program "/config/scripts/move4k.sh": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:87)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:70)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:65)
at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment .java:286)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536)
at script(:3)
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(JSHtmlUnitP ermissionRestricter.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:344)
at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:192)
at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:172)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 21 more
(#3)
at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:2053)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:179)
at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536)
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(JSHtmlUnitP ermissionRestricter.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:344)
at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:192)
at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:172)
Caused by: org.jdownloader.extensions.eventscripter.EnvironmentException: Line 3
java.io.IOException: Cannot run program "/config/scripts/move4k.sh": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:87)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:70)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:65)
at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment .java:286)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1536)
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(JSHtmlUnitP ermissionRestricter.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:344)
at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:192)
at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:172)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 21 more

at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment .java:289)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:153)
... 12 more
Caused by: java.io.IOException: Cannot run program "/config/scripts/move4k.sh": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:87)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:70)
at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:65)
at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment .java:286)
... 17 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 21 more

I run jdownloader in a docker on ubuntu 22.04 and use jlesage image
Thanks for the help

Last edited by wizhack; 14.04.2024 at 12:43.
Reply With Quote
  #2876  
Old 14.04.2024, 13:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@wizhack: script is executable? chmod +x
and the folders in the script are reachable/correct in docker?
The error happens when a.) file doesn't exist b.) file is not executable
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2877  
Old 14.04.2024, 14:09
dataDyne's Avatar
dataDyne dataDyne is offline
Baby Loader
 
Join Date: Mar 2024
Posts: 8
Arrow

Quote:
Originally Posted by mgpai View Post
Try replacing:
Code:
var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg)$/i, "$1mp3");
with:
Code:
var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg|opus)$/i, "$1mp3");
Yes! Works perfectly
This is the full script for converting all YouTube audio files (aac,m4a,ogg,opus) to MP3 320 Kbps bitrate.With the Trigger in Event Scripter activated "A Download stopped", 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 04:29.
Reply With Quote
  #2878  
Old 14.04.2024, 14:26
wizhack wizhack is offline
Baby Loader
 
Join Date: Apr 2024
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
@wizhack: script is executable? chmod +x
and the folders in the script are reachable/correct in docker?
The error happens when a.) file doesn't exist b.) file is not executable
Code:
docker exec jdownloader-2 ls -l /config/scripts/
-rwxrwxr-x    1 app      app             60 Apr 14 12:16 move4k.sh
This drive me crazy, file exist and executable, i tried different uid /gid but nothing happen.
How can i do with the builtin event scripter (without script shell) ?

Last edited by wizhack; 14.04.2024 at 14:33.
Reply With Quote
  #2879  
Old 14.04.2024, 20:51
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,013
Default

@wizhack: it would make much more sense in finding out why it doesn't work with your read2use script than reinventing the wheel. yes , it would be possible with eventscripter but you will have to wait for others to help you with this. about your script, check the following:
a.) can you execute the script in docker manually?
b.) is the script maybe on a mountpoint with NOEXEC option?
c.) what is the permission of folder /config
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2880  
Old 14.04.2024, 21:39
wizhack wizhack is offline
Baby Loader
 
Join Date: Apr 2024
Posts: 6
Default

Sooooooo i have got some news !!!! the file not found was for bash which was not found !!!
So on jlesage jdownloader (alpine based image) with docker you have to do :

1st you have to go in container shell :
Code:
docker exec -ti CONTAINER-NAME sh
once you are in the shell :
Code:
# apk update && add bash
I hope this will help some users in the future, i am familiar with debian based linux because of the unrevelant error message !

now i have some rights issues for moving folder to a nfs share which is mount in /mnt/4K.

Last edited by wizhack; 14.04.2024 at 21:50.
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 02:08.
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.