#161
|
|||
|
|||
![]()
I'm trying to make a simple Packagizer Hook to replace "_" with " ":
Code:
if (link.getHost() == "myhost.com") { link.setName(link.name.replace(/_/g, " ")) } |
#162
|
||||
|
||||
![]()
link gethost isn't the domain of the site, its the plugin names entry
hence 'http links' as its supported by directhttp plugin
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#163
|
|||
|
|||
![]()
How do you get the download URL?
|
#164
|
||||
|
||||
![]()
you can either use the package customiser and remove the chars with simple filename rule
contains *_* replace with $1$2 or you can use eventscripter, my guess would be myDownloadLink.getUrl() raztoki
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#165
|
|||
|
|||
![]()
This seems to work: (note: getURL not getUrl)
Code:
// Packagizer Hook to replace "_" with " " if (/.*myhost\.com.*/.test(link.getURL())) { link.setName(link.name.replace(/_/g, " ")) } Last edited by Luke M; 20.08.2017 at 15:41. |
#166
|
||||
|
||||
![]()
good stuff
Have fun with your filename renamer ;]
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#167
|
|||
|
|||
![]() Quote:
I'm new with JDownloader and i really like it. When i'm trying to copy the script above in my MyJDownloader eventscripter i'm receiving the following message: sorry failed to set value. Would you know why ? I'm using Jdownloader on my Dlink dns-325 nas to download audio file (m4a) but i would like them to be transfered in .mp3. Thanks |
#168
|
||||
|
||||
![]()
The most easiest way is to use a JDownloader with GUI, setup the script there via GUI and then copy/paste the value from advanced settings.
__________________
JD-Dev & Server-Admin |
#169
|
|||
|
|||
![]() Quote:
setup the script via GUI, do you mean in MyJDownloader ? Thats where i tried to copy the script to the event scripter in the setting and i got the error message. Not sure where i could have another GUI. Thanks |
#170
|
||||
|
||||
![]()
no he meant another JDownloader install with a GUI not webui.
gui jd copy paste into the event scripter then goto advanced > copy the advanced setting, this will contain all the json formatting/encoding > paste into the webui or just copy the json file across to the other system raztoki
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#171
|
|||
|
|||
![]() Quote:
|
#172
|
|||
|
|||
![]()
Hello,
is there a way to do a dry run of the script ? I'm trying to setup filebot using the provided link **External links are only visible to Support Staff****External links are only visible to Support Staff** I don't understand how I'm supposed to add these scripts. At first I thought I had to add both scripts inside the root path of jdownloader /usr/jdownloader And then copy the *eventscript*.json inside */cfg/ Now, reading the thread here. I did add both script *.js inside a gui jdownloader and then went inside advanced settings and copy/paste the json inside myjdownloader. But I still got the error " Sorry, failed to set the new value". Sorry, if the question is silly or the answer obvious ! Thanks. |
#173
|
||||
|
||||
![]()
Most easist way to setup this is to use a JDownloader with GUI and setup two events (Filename is Eventtype) and then copy/paste the value from Settings-Advanced Settings-EventScripter.scripts to your other JDownloader
__________________
JD-Dev & Server-Admin |
#174
|
|||
|
|||
![]() Quote:
I get "" Sorry, failed to set the new value". |
#175
|
|||
|
|||
![]()
You may get that error if you are trying to paste the code inside the square brackets '[]' in web UI. Try removing those brackets first and then pasting the code. Alternatively, you can copy the "org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json" file from 'JD Desktop' to 'JD Headless'.
|
#176
|
|||
|
|||
![]() Quote:
No Parts are stop and Start. No Reaction from Script? Edit Ok this Script Work. Restart Part under 600 kb Code:
//check if downloads are running at all if (isDownloadControllerRunning() && !isDownloadControllerStopping()) { var running = getRunningDownloadLinks(); //loop through all running Downloads for (var i = 0; i < running.length; i++) { //check if the download has been running at least 30 seconds if (running[i].getDownloadDuration() > 30000) { //check if the current speed is below 50kb/s if (running[i].getSpeed() < 600 * 1024) { //reset the download //running[i].reset(); //stop the download and restart it running[i].abort(); } } } } Last edited by Koto99; 06.09.2017 at 18:25. |
#177
|
||||
|
||||
![]()
@Koto99: The script from mgpai works fine. His script is about global average speed while yours is about individual download speed
![]() ![]()
__________________
JD-Dev & Server-Admin |
#178
|
|||
|
|||
![]()
Thanx
I missunderstod this. Im Searching for Part Speed reset not Global Speed:) |
#179
|
||||
|
||||
![]()
@Koto99: your modified script should work fine
__________________
JD-Dev & Server-Admin |
#180
|
|||
|
|||
![]()
Hi,
The script for saving comments doesn't work for couple of weeks now, I thought it was temporary issue but it still have a problem. comments aren't saved. I'm not sure whether it's script related or JDownloader related. could you please have a look? :-) Thank you, 0r3n. |
![]() |
Thread Tools | |
Display Modes | |
|
|