#561
|
|||
|
|||
OK, so I have to embed the js code in a jason syntax. But what is the correct identifiert for the trigger?
And jiaz said some years ago that before a reconnect is a problem, as after the update JD "forgets" to reconnect https://board.jdownloader.org/showpo...26&postcount=7 |
#562
|
|||
|
|||
Sorry, I should have read the other posts in that thread before I post the "issue" that the two of you discussed 4 years ago.
I embedded the scriptcode in json. It is valid jason (correctly escaped) according to **External links are only visible to Support Staff**... - however jd refused to accept it: „Sorry, failed to set new value“ Quote:
|
#563
|
|||
|
|||
Thanks for all the very useful scripts!
|
#564
|
||||
|
||||
@plaintext: easiest way would be to setup the eventscripter in JDownloader with GUI and then copy/paste the value from Settings-Advanced Settings-EventScripter.scripts
That way you don't have to care about format/encoding yourself
__________________
JD-Dev & Server-Admin |
#565
|
|||
|
|||
Oh, The WebUI has a GUI for the event Scripter so I expected it to be the same GUI as the Java Frontend.....
regarding the question before/after reconnect: If it is done after a reconnect, mgpai said this script would interrupt running downloads that started right after the reconnect. But: If it is done before a reconnect, how does JD know it has to reconnect after the update? I want to avoid solving CAPTCHAs just for JD to notice that is has to reconnect. Even worse it might break the reconnect. And even worse: Lets say download A causes the need to reconnect. As A is waiting for a reconnect, download B does not start. After update & reboot download B starts and A cannot continue as B is running .... Btw: what is the "APIPanel Visible" option? Jiaz said on page 11 "it shows/hides the api help panel" - but what/whee is the api help panel ? thank you. |
#566
|
||||
|
||||
Quote:
After installation -> download starts -> detects waiting time -> before reconnect -> no update available -> do reconnect -> continue download
__________________
JD-Dev & Server-Admin |
#567
|
||||
|
||||
Quote:
so I also think that check/install update on *After Reconnect* trigger would be better idea and the script can be in sync mode and other downloads would not start then
__________________
JD-Dev & Server-Admin |
#568
|
||||
|
||||
It's the api documentation for the GUI script editor available in GUI version
__________________
JD-Dev & Server-Admin |
#569
|
|||
|
|||
Quote:
Thank you for clarification. |
#570
|
||||
|
||||
There is no differentiation between gui and headless version for setting interfaces and the webui just shows generic interface for all available settings
__________________
JD-Dev & Server-Admin |
#571
|
|||
|
|||
Would it be possible to request a script that finds duplicate within the download list and another to verify that it has been downloaded? Having major issues organizing and cleaning mine after a few user screw ups.
|
#572
|
|||
|
|||
Can you contact me in JD Chat?
|
#573
|
|||
|
|||
Send Package Name to Batch
i'm trying to send package name to a batch file to send a push notification! the notification works as expected, but i like to include the package name, here are the scripts i'm testing
event scripter: Code:
// TRIGGER = Package Finished disablePermissionChecks(); var myFilePackage = package; var myString = myFilePackage.getName(); callAsync(function(exitCode, stdOut, errOut) {}, "F:\\link to\\file.bat", "myString"); batch: Code:
@echoff myString=$1 curl -X POST -d "payload={\"text\": \"JDownloader: A file "'$myString'" has been completed!\"}" "**External links are only visible to Support Staff** message received at notification service: Code:
JDownloader: A file '$myString' has been completed! any help will be appreciated! thanks in advance! :attention: |
#574
|
|||
|
|||
well, found out the errors in my scripts:
event scripter: Code:
// TRIGGER = Package Finished disablePermissionChecks(); var myFilePackage = package; var myString = myFilePackage.getName(); callAsync(function(exitCode, stdOut, errOut) {}, "F:\\link to\\file.bat", myString); Code:
@echoff %1 curl -g -v -k -X POST -d "payload={\"text\": \"JDownloader: The file "'%1'" has been completed!\"}" "**External links are only visible to Support Staff** message received at notification service: Code:
JDownloader: The file 'Example FilePackage Name' has been completed! :woot: Last edited by almanteka; 08.02.2019 at 00:26. |
#575
|
|||
|
|||
Event scripter also has a postPage() method, which can be used instead of the batch file in this script.
Code:
var myString = postPage(myString/*URL*/, myString/*PostData*/);/*Loads a website (METHOD: POST) and returns the source code*/ /* Example: */var myhtmlSourceString = postPage("http://support.jdownloader.org/index.php","searchquery=captcha"); |
#576
|
|||
|
|||
Quote:
|
#577
|
|||
|
|||
Example:
Code:
var url = "hxxp://notification.service"; var data = "payload={\"text\": \"JDownloader: The file " + package.getName() + " has been completed!\"}"; postPage(url, data); |
#578
|
|||
|
|||
WOW! worked perfectly! thank you very much!
|
#579
|
||||
|
||||
@almanteka: just out of interest, what notification service do you use?
__________________
JD-Dev & Server-Admin |
#580
|
|||
|
|||
i'm using Synology Chat.
|
#581
|
||||
|
||||
Is that an app for synology and you can push notifications to it? is it a real message service?
__________________
JD-Dev & Server-Admin |
#582
|
|||
|
|||
yes, it's an app to connect to your own synology server. you can push notifications using web hooks & slash commands, chat with other users using the app from windows desktop, android & iOS. i think it's not a real message service because you need a synology server for it to work, but it provides what i need after using slack & pushbullet and obtained the same experience. i used slack & pushbullet just to receive push notifications on my cell phones, now, i integrated those to my synology server.
Last edited by almanteka; 08.02.2019 at 20:23. |
#583
|
|||
|
|||
Hi almanteka
Would you mind PMing me about what kind of notifications you're setting this up for? Is it purely for download finished or something else? I also had this same idea recently, so I've build this functionality into the iOS MyJDownloader app. In the next iOS update users can simply tick boxes for various push notifications, and the app sets up the event scripter script as needed. At the moment I provide 11 push notification types (package started, package finished, downloads stopped etc..), but users are free to set up their own custom notifications based on the ones I've made (with mgpai's help), they just won't be able to turn them on/off through the app ui. I'm interested to know what other types of notifications users are wanting, and if you have any scripts you're willing to share that would be great. |
#584
|
||||
|
||||
@almanteka: Thanks! Didn't know it before
@Simon: I'm sorry for huge delay :(
__________________
JD-Dev & Server-Admin |
#585
|
|||
|
|||
Quote:
|
#586
|
|||
|
|||
Np. Do you have an idea of when you'll be free to look into it for me? Eager to push this version out.
|
#587
|
|||
|
|||
I saw that one of the triggers is "A new file has been created". How would I make script, witch would be add number before name of new file. Number will be: number of files in folder+1.
Second thing: I try to create history of downloaded links, using #7, but I get message that variable "link" is not define. What am I doing wrong? |
#588
|
|||
|
|||
Quote:
I had immediately replied (via PM) to your email. If you still have issues running the script, find me in JD Chat. Last edited by mgpai; 16.02.2019 at 05:15. |
#589
|
|||
|
|||
Hello together,
i want to ask if somebody can help me with a script. I want to set the download path of a new package wich is over 20gb to filme and all other bigger than 500mb to serien. As event i used "A new link has been added" var myLong = myPackagizerLink.getBytesTotal(); var filme = "E:\HD Filme"; var serien = "E:\Serien"; if (myLong > '20000000000') { myPackagizerLink.setDownloadFolder(filme); } No error comes but it does not working. Can anybody help? Regards |
#590
|
|||
|
|||
You have to use escape the backslash character:
Code:
var filme = "E:\\HD Filme"; or use (forward) slash as path separator. Code:
var filme = "E:/HD Filme"; Tried packagizer? You can create rules to set download folder (among other things) based on file size. |
#591
|
|||
|
|||
hi! i'm trying to adapt these two scripts to move the original "un-extracted" package to another folder after the extraction ocurred! i know that jdownloader can move the original files to the recycle bin, but i'm looking to move the original "un-extracted" package to another folder instead! thanks in advance for your suggestions & help!
ArchiveExtracted.js Code:
var script = 'F:\\JDownloader v2.0\\JDTest3.bat' var myFilePackage = package; var path = myFilePackage.getDownloadFolder() var name = myFilePackage.getName() var label = myFilePackage.getComment() ? myFilePackage.getComment() : 'N/A' var links = myFilePackage.getDownloadLinks() ? myFilePackage.getDownloadLinks() : [] function isReallyFinished() { for (var i = 0; i < links.length; i++) { if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) { return false } } return true } if (isReallyFinished()) { var command = [script, path, name, label, 'PACKAGE_FINISHED'] log(command) log(callSync(command)) } maybe this one? Code:
//Trigger: "Archive Extraction Finished" var packageFinished = archive.getDownloadLinks()[0].getPackage().isFinished(); var folder = archive.getDownloadLinks()[0].getPackage().getDownloadFolder(); var name = archive.getDownloadLinks()[0].getPackage().getName(); if (packageFinished) { alert("External Command " + " Parameter1: " + folder + " Parameter2: " + name); } JDTest3.bat Code:
@ECHO OFF set ARG_NAME=%1 move "F:\\JD Downloads\\%ARG_NAME%" "F:\\!TRASH!" :thumbup: |
#592
|
|||
|
|||
Quote:
Code:
// Move archive files after extraction // Trigger: Archive Extraction Finished var links = archive.getDownloadLinks() || []; links.forEach(function(link) { var filePath = getPath(link.getDownloadPath()); filePath.moveTo(filePath.getParent().toString().replace("JD Downloads", "!TRASH!")); }); Last edited by mgpai; 17.02.2019 at 07:00. |
#593
|
|||
|
|||
Quote:
Last edited by almanteka; 17.02.2019 at 08:06. Reason: tested with multiple files too! |
#594
|
|||
|
|||
Quote:
var filme = "E:/HD Filme"; But nothing happend. I can´t use packagizerbecause there is no option to filter by package size only by file size. I want to filter the packagesize. Or i must i use a different var? myDownloadLink? Regards |
#595
|
|||
|
|||
This returns only the link size, not the package size.
Quote:
Code:
var myLong = myCrawledPackage.getBytesTotal(); var myLong = myFilePackage.getBytesTotal(); Only "Package Finished" trigger returns the "package" sandbox. In all other cases you have to get the "package" sandbox using methods which return packages or links. |
#596
|
|||
|
|||
Thanks mgpai,
now i use myCrawledPackage.getBytesTotal(); All working. Thanks for your help. |
#597
|
|||
|
|||
Is it possible to create script for disable "LinkgrabberSettings: Various Package" if package name is "Some_Package_Name".
I want to disable it when am downloading from some selected youtube channels. |
#598
|
||||
|
||||
@pinko: you can create a Settings-Packagizer rule to avoid links going into the various package. If you can explain what exactly you're trying to achieve, I can try to help
__________________
JD-Dev & Server-Admin |
#599
|
|||
|
|||
I was told to ask mgpai for help with eventscript from here, https://board.jdownloader.org/showthread.php?t=79841
So, @mgpai Can U make me a eventscript which will automatically grab proxies from here **External links are only visible to Support Staff****External links are only visible to Support Staff** Thanks in advance. |
#600
|
|||
|
|||
Quote:
Hope you have tried the bulk proxies import feature in JD Connection Manager. I can create a script which can automatically download the lists at specific intervals, but I guess it wont help you much. |
Thread Tools | |
Display Modes | |
|
|