JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #321  
Old 16.02.2018, 17:15
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,636
Default

Quote:
Originally Posted by RPH View Post
... It's thus not possible for me to sit and wait for the permission dialog box to appear on myJDownloader.
Temporary workaround? : Change system time to Trigger Script > Set Permission > Restore System Time.

Last edited by mgpai; 16.02.2018 at 17:16. Reason: Typo
Reply With Quote
  #322  
Old 16.02.2018, 17:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

After next Update you'll have new commands
disablePermissionChecks();
enablePermissionChecks();
Update will be available in next 5 mins
__________________
JD-Dev & Server-Admin
Reply With Quote
  #323  
Old 16.02.2018, 17:18
RPH
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
I will add easy method to disable permission checks
Thank-you very much ! This will be useful for future scripts as well.

A new update just became available so using myJDownloader I set my "update check" event's interval to 1000ms, disabled and re-enabled the script, and then the permission box appeared. Hopefully now it will not ask for the permissions again since I did not modify the script since accepting the permissions.

Quote:
Originally Posted by Jiaz View Post
After next Update you'll have new commands
disablePermissionChecks();
enablePermissionChecks();
Update will be available in next 5 mins
Thanks ! I just put the command in the beginning of script ?

Last edited by RPH; 16.02.2018 at 17:21.
Reply With Quote
  #324  
Old 16.02.2018, 17:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

just add
disablePermissionChecks();
in beginning of your script to disable checks
__________________
JD-Dev & Server-Admin
Reply With Quote
  #325  
Old 16.02.2018, 17:24
RPH
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
just add
disablePermissionChecks();
in beginning of your script to disable checks
Superb !
Reply With Quote
  #326  
Old 16.02.2018, 20:41
netgearjd netgearjd is offline
Registered / Inactive
 
Join Date: Aug 2014
Posts: 92
Default

Quote:
Originally Posted by mgpai View Post
Script Updated:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd.js
Superb, thanks once again!

Quote:
Originally Posted by Jiaz View Post
After next Update you'll have new commands
disablePermissionChecks();
enablePermissionChecks();
Update will be available in next 5 mins
Jiaz, how about the new API I requested above?

Edit: @mgpai, I wonder if you'd be so kind as to help me with a related script. This time I want to disable all links in a given package in the Downloads/LinkGrabber list whose file names match file names in the related download folder.

So for example if I have a package named "Jan Reports" and it's to be saved to Drive:\PackageName, then the script should match all file names in that package with file names in "Drive:\Jan Reports" and disable all matches. Basically it's the same script as before, except this time the comparison is to actual file names on disk instead of file names in a text file. Is this possible?

Last edited by netgearjd; 16.02.2018 at 20:54.
Reply With Quote
  #327  
Old 16.02.2018, 20:50
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@netgearjd: will be available with next update in 5 mins
__________________
JD-Dev & Server-Admin
Reply With Quote
  #328  
Old 16.02.2018, 23:01
netgearjd netgearjd is offline
Registered / Inactive
 
Join Date: Aug 2014
Posts: 92
Default

@Jiaz: What function name should I use?
Reply With Quote
  #329  
Old 17.02.2018, 10:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,636
Default

Quote:
Originally Posted by netgearjd View Post
... I want to disable all links in a given package in the Downloads/LinkGrabber list whose file names match file names in the related download folder...
Script Created:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd_2.js

Quote:
Originally Posted by netgearjd View Post
@Jiaz: What function name should I use?
Script updated:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd.js
Reply With Quote
  #330  
Old 17.02.2018, 13:39
RPH
Guest
 
Posts: n/a
Question

Hi guys, sorry another quick question. With the code below, is it possible to wait for the runUpdateCheck() to finish before checking if an update is available on the next line of code ? Or maybe there is an all in one API that runs the update check and then updates/restarts if there is one ? Also, where can I find a list of JDownlaoder's APIs ?

Or is it possible to runUpdateCheck() using crontab instead ?

EDIT: I guess I could just add a sleep() command after calling runUpdateCheck().

Thanks

Code:
runUpdateCheck();
if (isDownloadControllerIdle() && isUpdateAvailable()) {
    interval = 1000;
    restartAndUpdate();
}

//Functions

function runUpdateCheck() {
    callAPI("update", "runUpdateCheck");
}

function isUpdateAvailable() {
    return callAPI("update", "isUpdateAvailable");
}

function restartAndUpdate() {
    callAPI("update", "restartAndUpdate");
}

Last edited by RPH; 17.02.2018 at 16:06.
Reply With Quote
  #331  
Old 19.02.2018, 12:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@netgearjd
getComment and setComment
@RPH: once an update is available, isUpdateAvailable will return true. So I would not think about async check just schedule the script for example all 15 mins. (default is 5 and 60 mins on headless)
__________________
JD-Dev & Server-Admin
Reply With Quote
  #332  
Old 19.02.2018, 15:18
RPH
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
@RPH: once an update is available, isUpdateAvailable will return true. So I would not think about async check just schedule the script for example all 15 mins. (default is 5 and 60 mins on headless)
Hi, I have auto-update turned off. I only wanted to check for updates once a day at a specific time and if there are updates available then install them before my downloads are scheduled to start.

For example:

03:45 AM - Check for updates / download updates
- If updates available, install updates

04:00 AM - Start downloads

Problem is that runUpdateCheck() doesn't have a return value so the script doesn't wait for the update check to finish before checking if there are updates to install (so they don't get installed). I think I solved this temporarily by adding a sleep(300000) command after runUpdateCheck().
Reply With Quote
  #333  
Old 19.02.2018, 15:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

Adding sleep will help yes. You could also enable auto update and JDownloader will check for pending updates itself. Without restart core updates are not installed. Don't see any reason not to enable auto update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #334  
Old 19.02.2018, 16:02
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,636
Default

Quote:
Originally Posted by RPH View Post
... where can I find a list of JDownlaoder's APIs ?
Other than the ones listed in the editor?

Code:
docs.google.com/document/d/1IGeAwg8bQyaCTeTl_WyjLyBPh4NBOayO0_MAmvP5Mu4
Reply With Quote
  #335  
Old 19.02.2018, 17:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@RPH:
@mgpai: Better api list
https://my.jdownloader.org/developers/
__________________
JD-Dev & Server-Admin
Reply With Quote
  #336  
Old 19.02.2018, 20:28
RPH
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Adding sleep will help yes. You could also enable auto update and JDownloader will check for pending updates itself. Without restart core updates are not installed. Don't see any reason not to enable auto update
I didn't want to have JDownloader unnecessarily checking for updates throughout the day (I saw the default value is every 10 minutes). And I want the latest updates available to be installed right before my downloads start to ensure that there will be no problems with plugins during downloading.

If there are only non-core updates available, will JDownloader still restart when running the "UpdateAndRestart()" command ?
Reply With Quote
  #337  
Old 20.02.2018, 11:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@RPH: Plugin updates can be installed in background without restart. Also headless is minimum timeout 1hour and not what's defined in advanced settings. Only pending core updates require a restart.
restartAndUpdate -> triggers a restart and enforces update check on startup.
Headless version always checks for updates on startup
__________________
JD-Dev & Server-Admin
Reply With Quote
  #338  
Old 20.02.2018, 12:14
RPH
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
@RPH: Plugin updates can be installed in background without restart. Also headless is minimum timeout 1hour and not what's defined in advanced settings. Only pending core updates require a restart.
restartAndUpdate -> triggers a restart and enforces update check on startup.
Headless version always checks for updates on startup
Ok so with my code below, if runUpdateCheck() finds only plugin updates (non-core), will it still force an unnecessary restart with restartAndUpdate() ? Then maybe I should re-enable auto-update checking so that the system doesn't restart just to install some plugin updates. Thanks.

Code:
runUpdateCheck();
sleep(300000);
if (isDownloadControllerIdle() && isUpdateAvailable()) {
    interval = 1000;
    restartAndUpdate();
}
Reply With Quote
  #339  
Old 20.02.2018, 12:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

restartAndUpdate will always restart and force an update check, yes
but only when isUpdateAvailable() is true, which is only the case for pending core updates as runUpdateCheck will install plugin updates in background if possible
__________________
JD-Dev & Server-Admin
Reply With Quote
  #340  
Old 20.02.2018, 13:03
RPH
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
restartAndUpdate will always restart and force an update check, yes
but only when isUpdateAvailable() is true, which is only the case for pending core updates as runUpdateCheck will install plugin updates in background if possible
Ahh, that makes sense, thanks
Reply With Quote
  #341  
Old 22.02.2018, 00:31
Taobaibai
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
Extraction Scheduler
Code:
// Schedule Extraction
// Trigger Required: Interval
// Disable Auto Extract in Archive Extractor
// Forum Topic: https://board.jdownloader.org/showthread.php?t=70655

var t = [21, 30]; //Set Starting Time [hours,minutes] e.g. [21,30] is 9:30 PM

if ((new Date().setHours(t[0], t[1], 0, 0) % new Date() < interval)) {
    var links = getAllDownloadLinks();

    for (i = 0; i < links.length; i++) {
        var link = links[i];
        var autoExtract = link.getArchive().getInfo().autoExtract;

        if (link.isFinished() && link.getArchive() && link.getExtractionStatus() == null && autoExtract != "FALSE") {
            callAPI("extraction", "startExtractionNow", [link.getUUID()], []);
        }
    }
}



Doesn't work for me? Is there an update?
Reply With Quote
  #342  
Old 22.02.2018, 10:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@Taobaibai: Did you make sure to use the correct trigger?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #343  
Old 22.02.2018, 11:25
Taobaibai
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
@Taobaibai: Did you make sure to use the correct trigger?
this one?

Quote:
Trigger Required: Interval
Reply With Quote
  #344  
Old 22.02.2018, 11:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

Yes, and what exactly doesn't work for you?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #345  
Old 22.02.2018, 11:30
Taobaibai
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Yes, and what exactly doesn't work for you?
it extracts while downloading. I just want to finish all my downloads before extracting.
Reply With Quote
  #346  
Old 22.02.2018, 11:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

Did you disable autoextraction, see
#Disable Auto Extract in Archive Extractor
Also note that links in list must be changed manually first. Select them and rightclick context menu and disable extraction.
Changing default value will only affect new added links
__________________
JD-Dev & Server-Admin
Reply With Quote
  #347  
Old 22.02.2018, 12:06
Taobaibai
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Did you disable autoextraction, see
#Disable Auto Extract in Archive Extractor
Also note that links in list must be changed manually first. Select them and rightclick context menu and disable extraction.
Changing default value will only affect new added links

No, it is enabled,

so all new Links will be extracted after finishing downloading?
Reply With Quote
  #348  
Old 22.02.2018, 12:59
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

I didn't test that script myself but that's what it should do.
Important is that this only works when links in list are set to auto extraction disabled. Default Auto-Extract only affects new added links
__________________
JD-Dev & Server-Admin
Reply With Quote
  #349  
Old 22.02.2018, 14:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,636
Default

Quote:
Originally Posted by Taobaibai View Post
Doesn't work for me? Is there an update?
To extract archives at scheduled time (Runs only once a day. Does not wait for all download to finish), use the old (rewritten) script:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Taobaibai.js

Quote:
Originally Posted by Taobaibai View Post
it extracts while downloading. I just want to finish all my downloads before extracting.
To extract archives only after all downloads have finished, use this new script:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Taobaibai_2.js

If you want the links which are currently on your list to be extracted by the script, make sure that 'auto extraction' has been disabled for those links. You can select those links and view/change their extraction settings using "Archive(s)" sub menu in the context menu or "Package/Link Properties Panel" in the bottom tool bar.
Reply With Quote
  #350  
Old 22.02.2018, 16:32
netgearjd netgearjd is offline
Registered / Inactive
 
Join Date: Aug 2014
Posts: 92
Default

Quote:
Originally Posted by mgpai View Post
Script Created:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd_2.js
Script updated:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd.js
Fantastic; thanks yet again.

Quote:
Originally Posted by Jiaz View Post
@netgearjd
getComment and setComment
Cheers, seemed obvious but thought it's best to confirm.

Quote:
Originally Posted by mgpai View Post
Code:
docs.google.com/document/d/1IGeAwg8bQyaCTeTl_WyjLyBPh4NBOayO0_MAmvP5Mu4
Quote:
Originally Posted by Jiaz View Post
Better api list
Code:
my.jdownloader.org/developers/
How up to date are these? I'm only asking because for example getComment and setComment seem to be missing from both, so I wonder what else might not have been added yet...
Reply With Quote
  #351  
Old 22.02.2018, 16:37
Taobaibai
Guest
 
Posts: n/a
Default

To extract archives only after all downloads have finished, use this new script:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Taobaibai_2.js


Thank you, that was what I was looking for!!!!
Reply With Quote
  #352  
Old 22.02.2018, 16:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@netgearjd: we update the static version from time to time. You can always fetch the live one from your own JDownloader. Enable Settings-Advanced Settings-RemoteAPI.deprecatedapienabled and visit localhost:3128/help
You should disable this if not required.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #353  
Old 22.02.2018, 17:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,636
Default

Quote:
Originally Posted by netgearjd View Post
... getComment and setComment seem to be missing from both ...
Event scripter methods will not be listed in those documents. You can find them in the the script editor help menu. All methods will appear in the built-in list, as and when they are made available by the developers.
Reply With Quote
  #354  
Old 22.02.2018, 18:35
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@netgearjd: sorry, mixed up api with eventscripter
@mgpai: thanks
__________________
JD-Dev & Server-Admin
Reply With Quote
  #355  
Old 26.02.2018, 01:11
netgearjd netgearjd is offline
Registered / Inactive
 
Join Date: Aug 2014
Posts: 92
Thumbs up

Quote:
Originally Posted by mgpai View Post
Event scripter methods will not be listed in those documents. You can find them in the the script editor help menu. All methods will appear in the built-in list, as and when they are made available by the developers.
Good to know, thanks!
Reply With Quote
  #356  
Old 02.03.2018, 06:33
patriks's Avatar
patriks patriks is offline
DSL User
 
Join Date: Aug 2017
Location: Brasil
Posts: 36
Default

Hello, can someone help me to create a simple script, I need to replace the "clearList" script by a script who does the "Start All Downloads" function (see the image). I need to force linkgrabber to send links to downloads (when autoconfirm does not work). I tested several scripts from the documentation, but without success.

I use the "clearList" a long time, because after the jdownloader stays open on for a long time the "autoconfirm" stops working, being necessary to clear the list and start over.

Reply With Quote
  #357  
Old 02.03.2018, 10:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@patrik: what exactly doesnt work about *autoconfirm* ? You know about the timeout of it ? maybe auto confirm works but there is a confirmation dialog about offline/incomplete archives and without answering this dialog, nothing will happen.
You can check Settings-Advanced Settings-confirm
__________________
JD-Dev & Server-Admin
Reply With Quote
  #358  
Old 02.03.2018, 10:52
dxzdxz1 dxzdxz1 is offline
Registered / Inactive
 
Join Date: Nov 2017
Posts: 26
Default

I'm trying to create a script that does the follow actions:


On a batch download, after each download and extraction finishes I would like to run this command:

compact.exe /c /exe:lzx *

for every new downloaded file

I have tried to do with this

Code:
var compact = "compact.exe";
var file = "archive(getExtractedFilePaths).getExtension()"; {
    callAsync(function() {}, compact, "/c", "/exe:lzx", file);
}
But is not working

Where the script is wrong and how can I fix it?
Reply With Quote
  #359  
Old 02.03.2018, 11:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,326
Default

@dxzdxz1: syntax and usage looks very wrong.
file is a string "archive(getExtractedFilePaths).getExtension()"?
I guess you want the compact.exe called for every file or on the extraction folder?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #360  
Old 02.03.2018, 11:17
dxzdxz1 dxzdxz1 is offline
Registered / Inactive
 
Join Date: Nov 2017
Posts: 26
Default

Quote:
Originally Posted by Jiaz View Post
@dxzdxz1: syntax and usage looks very wrong.
file is a string "archive(getExtractedFilePaths).getExtension()"?
I guess you want the compact.exe called for every file or on the extraction folder?

Exactly. I want to run compact for every file on the extraction folder.

Compact is a built in Windows 10 tool to transparent compression (similar to that old NTFS compression).
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 03:17.
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.