JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #381  
Old 13.03.2018, 21:10
patriks's Avatar
patriks patriks is offline
Super Loader
 
Join Date: Aug 2017
Location: Brasil
Posts: 29
Default

Quote:
Originally Posted by Jiaz View Post
This has nothing to do with script. duplicate handling is global and independent how you've added the links. First you should check if duplicate detection works, the links should be highlighted in different color.
Also check Settings-Advanced Settings-LinkgrabberSettings.handledupesonconfirmlatestselection
and
LinkgrabberSettings.defaultonaddeddupeslinksaction
Jiaz, all options to prevent dupes are active
Jd does not create duplicates when I add manually or by "autoconfirm", this only happens with the "moveToDownloadlist" script.


@edit
The Scheduler plugin with "Add All Downloads" action also adds duplicates in Downloads.

Last edited by patriks; 13.03.2018 at 21:14.
Reply With Quote
  #382  
Old 13.03.2018, 21:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

The API method *moveToDownloadlist* does exactly what it states, move the given links/packages to downloadlist. There is no dupe handling at all for this. Same for Scheduler. It adds them all.
DupeSettings are for manual/auto confirm adding

I can add a new api method so you can check for dupes and remove them first.
I will add it tomorrow morning
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 13.03.2018 at 21:37.
Reply With Quote
  #383  
Old 14.03.2018, 10:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

Thanks to mgpai!
You can use following method after next core update to remove dups
callAPI("linkgrabberv2", "cleanup", [], [], "DELETE_DUPE", "REMOVE_LINKS_ONLY", "ALL");
__________________
JD-Dev & Server-Admin
Reply With Quote
  #384  
Old 14.03.2018, 11:11
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,528
Default

Quote:
Originally Posted by patriks View Post
... is it possible to make the script ignore and delete the duplicate links?
Script Updated:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/patriks.js

Quote:
Originally Posted by patriks View Post
I'm testing this script, but not work, no error message. Did I do something wrong?
Have you renamed "EventScripter Trigger" to "Export URLs"? The button name in context menu should be the same as the one used in script.
Reply With Quote
  #385  
Old 14.03.2018, 22:19
patriks's Avatar
patriks patriks is offline
Super Loader
 
Join Date: Aug 2017
Location: Brasil
Posts: 29
Default

Quote:
Originally Posted by mgpai View Post
Script Updated:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/patriks.js
mgpai/Jiaz thank you very much for help me with the scripts.
This script is exactly what I wanted, but when there are no links in linkgrabber it gives an error in this line:

Code:
// Move all links to download list
// Related Post: https://board.jdownloader.org/showpost.php?p=419538&postcount=364

moveAllToDownloadList();

// Function
function moveAllToDownloadList() {
    callAPI("linkgrabberv2", "cleanup", [], [], "DELETE_DUPE", "REMOVE_LINKS_ONLY", "ALL");
    getAllCrawledPackages().forEach(function(package) {
        callAPI("linkgrabberv2", "moveToDownloadlist", [], [package.getUUID()]);
    });
}
Code:
Caused by: org.appwork.remoteapi.exceptions.BadParameterException: BAD_PARAMETERS(ERROR_BAD_REQUEST)
	at org.jdownloader.api.utils.PackageControllerUtils.cleanup(PackageControllerUtils.java:391)
	at org.jdownloader.api.linkcollector.v2.LinkCollectorAPIImplV2.cleanup(LinkCollectorAPIImplV2.java:729)
I want to run this script with interval(30s). How to make it ignore the error message?

Quote:
Originally Posted by mgpai View Post
Have you renamed "EventScripter Trigger" to "Export URLs"? The button name in context menu should be the same as the one used in script.
Now it works, thank you.
Reply With Quote
  #386  
Old 15.03.2018, 10:24
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,528
Default

Quote:
Originally Posted by patriks View Post
... when there are no links in linkgrabber it gives an error ... How to make it ignore the error message?
Script Updated:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/patriks.js

Last edited by mgpai; 15.03.2018 at 12:20. Reason: Redundant
Reply With Quote
  #387  
Old 15.03.2018, 11:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@patriks: will be fixed with next update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #388  
Old 16.03.2018, 23:50
patriks's Avatar
patriks patriks is offline
Super Loader
 
Join Date: Aug 2017
Location: Brasil
Posts: 29
Default

My remote jdownloader is working perfectly for more than a day oppened, thanks a lot Jiaz and mgpai for the help with the scripts and updates.

final result:

Spoiler:
1. grab all links as listed in the .txt
https://board.jdownloader.org/showpo...64&postcount=9
Code:
disablePermissionChecks(); {
    callAPI("linkgrabberv2", "addLinks", {
        "autostart": true,
        "autoConfirm": true,
        "deepDecrypt": false,
        "links": readFile("_jd3b.txt")
    })
}

2. Move all links to download list, except duplicates.
https://board.jdownloader.org/showpo...&postcount=376
Code:
// Move all links to download list
disablePermissionChecks();
moveAllToDownloadList();

// Function
function moveAllToDownloadList() {
    callAPI("linkgrabberv2", "cleanup", [], [], "DELETE_DUPE", "REMOVE_LINKS_ONLY", "ALL");
    getAllCrawledPackages().forEach(function(package) {
        callAPI("linkgrabberv2", "moveToDownloadlist", [], [package.getUUID()]);
    });
}

3. "download history" with instagram/vkontakte direct url
https://board.jdownloader.org/showpo...&postcount=232
Code:
// Save Link URLs
// Files will be created in default (Global) download folder
// Trigger Required: A Download Stopped
disablePermissionChecks();

// Function
function now() {
    var d = new Date();
    var t = d.toString().split(" ");
    return t[3] + ('0' + (d.getMonth() + 1)).slice(-2) + t[2] + " " + t[4];
}

if (link.isFinished()) {
    var data = "<details open><summary>" + link.getName() + "</summary><table>";

    var urls = {
        "Content": link.getContentURL(),
        "Container": link.getContainerURL(),
        "Origin": link.getOriginURL(),
        "Referrer": link.getReferrerURL(),
        "Date": now(),
        "instagram": link.getProperty("directurl"),
        "other": link.getProperty("url"),
        "vkontakte": link.getProperty("picturedirectlink"),
    };

    for (x in urls) {
        if (urls[x]) data += "<tr><td>" + x + "</td><td> : <a href=\"" + urls[x] + "\">" + urls[x] + "</a></td></tr>";
    }

    data += "</table></details>";


    var b /*history folder*/ = JD_HOME + "/";
    var c /*file Name */ = "_history.htm";


    writeFile(b + c, data, true);
}
Reply With Quote
  #389  
Old 23.03.2018, 06:31
Peteisanidiot
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Wicküler View Post
Don't know if this should be posted since it's so simple, but I wanted a way of getting notifications on my phone via pushover when a package had finished. It was quite easy and using the code
Code:
postPage("**External links are only visible to Support Staff**,
"token=appToken&user=userKey&message="
+ package.getName() +
" finished.");
with the Trigger "Package finished" is all that was needed. The userKey is located in your pushover-profile-page and the appToken can be generated there as well via "Create an API token" (somewhere near the bottom under "Your applications").

Works like a charm but if this thread is meant for more elaborate scripts, feel free to move or delete this post. Since I didn't find any other hints or tutorials for using pushover for jdownloader-notifications, I thought I'd just leave it here.
i know that this post is a bit old but i cannot get this script to work. any tips?
Reply With Quote
  #390  
Old 23.03.2018, 09:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@Peteisanidiot: What problem do you have? What doesn't work? Any error message or what exactly?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #391  
Old 23.03.2018, 13:54
Peteisanidiot
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
@Peteisanidiot: What problem do you have? What doesn't work? Any error message or what exactly?
I made some progress but can’t get the actual file name to be reflected in the notification - all messages just say “various files have finished.”
Reply With Quote
  #392  
Old 23.03.2018, 14:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

package.getName will return the package name. You can use same call for download finished event and use link.getName()
__________________
JD-Dev & Server-Admin
Reply With Quote
  #393  
Old 23.03.2018, 15:56
Peteisanidiot
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
package.getName will return the package name. You can use same call for download finished event and use link.getName()
Perfect! Thanks much.
Reply With Quote
  #394  
Old 23.03.2018, 16:07
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

You're welcome Glad that you finally got it working
__________________
JD-Dev & Server-Admin
Reply With Quote
  #395  
Old 26.03.2018, 21:12
dariusmk dariusmk is offline
JD Fan
 
Join Date: Aug 2011
Posts: 79
Default

Hi,

Is there a script available that prevents jdownloader from unzipping / unraring downloaded files until all downloads in the download list are completed?

Regards,
dariusmk
Reply With Quote
  #396  
Old 27.03.2018, 09:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,528
Default

@dariusmk: Post #349
Reply With Quote
  #397  
Old 27.03.2018, 16:26
dariusmk dariusmk is offline
JD Fan
 
Join Date: Aug 2011
Posts: 79
Default

Quote:
Originally Posted by mgpai View Post
@dariusmk: **External links are only visible to Support Staff**...
Thanks for the quick reply!
Reply With Quote
  #398  
Old 30.03.2018, 17:12
Biohazmatz
Guest
 
Posts: n/a
Default

Hi guys,

I am looking for a script that does the following.

Situation:

Package1
- file1.part01.rar
- file1.part02.rar
- file1.part03.rar
...
- file2.part01.rar
- file2.part02.rar
- file2.part03.rar
...

1. When all parts of file1 are downloaded and the archive extraction has started, I want the downloading to be paused/stopped.
2. When the file has been successfully extracted, wait 1 minute
3. Start the download again

- Repeat for all extraction events
(Step 2 is optional)

Any help would be appreciated!
Reply With Quote
  #399  
Old 30.03.2018, 18:22
dariusmk dariusmk is offline
JD Fan
 
Join Date: Aug 2011
Posts: 79
Default

Quote:
Originally Posted by mgpai View Post
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
@mgpai: What is the correct trigger for the script? "ON_DOWNLOAD_CONTROLLER_STOPPED"?

Thank you.
Reply With Quote
  #400  
Old 30.03.2018, 19:32
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,528
Default

Trigger specified in the script is "ON_PACKAGE_FINISHED", but will also work fine with "ON_DOWNLOAD_CONTROLLER_STOPPED". If you manually start/stop the downloads often, use the former.

Also, the script currently checks the status of individual downloads. It can be modified to check just the status of packages instead.
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 04:32.
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.