#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 16: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 19:25. |
#177
|
||||
|
||||
@Koto99: The script from mgpai works fine. His script is about global average speed while yours is about individual download speed thats huge difference. Your screenshot shows nearl 5mb/s but the script triggers at global average speed < 128 kb/s
__________________
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. |
#181
|
||||
|
||||
@or3n: you know the script only works for packages, not individual links?
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 08.09.2017 at 19:32. |
#182
|
|||
|
|||
The script is working fine. For which site do you use the script? Does that plugin still write the description to the comments field?
|
#183
|
|||
|
|||
Quote:
Quote:
so if the comments doesn't appear in JDownloader "comments" column it's a plugin issue? |
#184
|
||||
|
||||
@0r3n: wait for plugin update. comment handling was broken because of instagram site changes
__________________
JD-Dev & Server-Admin |
#185
|
|||
|
|||
hi
sorry to disturb you for that but the mgpai script for sorting files by duration (https://board.jdownloader.org/showpo...&postcount=159) cant be started for every "files" but only "bundle" we dont have "file finished" trigger in "event scripter" is it possible to fix that by something more inside the script or a new trigger ps : if i select "interval" i have an error (https://i.imgur.com/jzou6a2.png) thx in advance |
#186
|
||||
|
||||
You have to use the trigger "Download Stopped" as commented in the script
__________________
JD-Dev & Server-Admin |
#187
|
|||
|
|||
ho my bad sry thank you im gonna try this
|
#188
|
|||
|
|||
Thanks Jiaz, after the update everything is working
|
#189
|
||||
|
||||
@03rn: you're welcome
__________________
JD-Dev & Server-Admin |
#190
|
|||
|
|||
good morning,
will it work for me? (deleted files in download folder) Code:
// Delete from download folder, any file/folder which contains user specified keywords // Trigger required: "A Download Stopped" package.getDownloadFolder().forEach(function(file) { var re = /.*(ajax-loader|url).*/; var junkFile = re.test(file.getName()); var junkFolder = re.test(file.getParent().getName()); if (junkFile) file.delete(); if (junkFolder) file.getParent().deleteRecursive(); }); I want the download to be finished, check if there is a pdf file, if so, this is started F:\Downloads\files\PDFConverter.exe "%DEPACKFOLDER%" "%DEPACKFOLDER%" -c PNG -p 1 -pd 4x5 "%DEPACKFOLDER%" = DownloadFolder is that possible? Last edited by Informativ; 17.09.2017 at 11:00. Reason: edit |
#191
|
|||
|
|||
Quote:
If you always want to delete such files, it is better to use linkfilter and prevent the links from being added to JD in the first place, rather than downloading, and deleting them later using event scripter. Quote:
Code:
// Run external program if package contains 'pdf' file // Trigger: "Package finished" var pdf = package.getDownloadLinks().some(function(link) { return getPath(link.getDownloadPath()).getExtension() == "pdf"; }); if (pdf) { var downloadFolder = package.getDownloadFolder(); var converter = "f:/downloads/files/pdfConverter.exe"; callAsync(function() {}, converter, downloadFolder, downloadFolder, "-c", "PNG", "-p", "1", "-pd", "4x5"); } |
#192
|
|||
|
|||
hi mgpai,
if no pdf available, that comes
Spoiler:
Quote:
|
#193
|
||||
|
||||
looks like copy/paste error or invalid script. error is about syntax error in script
__________________
JD-Dev & Server-Admin |
#194
|
|||
|
|||
hi,
is it possible to stop this part and then restart it?
Spoiler:
|
#195
|
|||
|
|||
Hi.
Textbox contents in messagebox is invisible height. How change height? Code:
alert("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); Last edited by pachi; 08.10.2017 at 05:47. |
#196
|
|||
|
|||
Quote:
Code:
alert("myString"+"\r\n"); |
#197
|
|||
|
|||
Thank you!
|
#198
|
||||
|
||||
__________________
JD-Dev & Server-Admin |
#199
|
|||
|
|||
Quote:
says ReferenceError: "linkcheckDone" is not defined. (#28) |
#200
|
|||
|
|||
It works here on last JD 2.0 #617. So nothing to fix.
|
Thread Tools | |
Display Modes | |
|
|