JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #81  
Old 01.12.2020, 13:08
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 668
Default

Hier sind die Skripte, die "history" enthalten:

Code:
// Add selected linkgrabber links to history, and remove them from the list
// Tirgger required: Linkgrabber Contextmenu Button Pressed
// Customize linkgrabber context menu > Add new "Eventscripter Trigger" button > Rename it to "Move to history" (without quotes) > Change Icon (optional)

if (name == "Move to history") {
    var historyFile = getPath(JD_HOME + "/cfg/history.txt");
    if (!historyFile.exists()) writeFile(historyFile, "", true);
    var history = readFile(historyFile);

    var linkUrls = [];
    var linkIds = [];

    var removeLinks = function(linkIds) {
        callAPI("linkgrabberv2", "removeLinks", linkIds, []);
    }

    lgSelection.getLinks().forEach(function(link) {
        var url = link.getUrl();
        var id = link.getUUID();

        if (history.indexOf(url) == -1) linkUrls.push(url);
        linkIds.push(id);
    })

    if (linkUrls.length) {
        data = "Added from the lingkrabber list on " + Date().toString().substring(4, 24) + "\r\n";
        data += linkUrls.join("\r\n") + "\r\n\r\n";
        writeFile(historyFile, data, true);
    }

    if (linkIds.length) removeLinks(linkIds);
}
Code:
// Add finished download links from selection to history, and remove them from the list
// Tirgger required: Downloadlist Contextmenu Button Pressed
// Customize downloadlist context menu > Add new "Eventscripter Trigger" button > Rename it to "Move to history" (without quotes) > Change Icon (optional)

if (name == "Move to history") {
    var historyFile = getPath(JD_HOME + "/cfg/history.txt");
    if (!historyFile.exists()) writeFile(historyFile, "", true);
    var history = readFile(historyFile);

    var linkUrls = [];
    var linkIds = [];

    var removeLinks = function(linkIds) {
        callAPI("downloadsV2", "removeLinks", linkIds, []);
    }

    dlSelection.getLinks().forEach(function(link) {
        if (link.isFinished()) {
            var url = link.getContentURL() || link.getPluginURL();
            var id = link.getUUID();

            if (history.indexOf(url) == -1) linkUrls.push(url);
            linkIds.push(id);
        }
    })


    if (linkUrls.length) {
        data = "Added from the downloadlist list on " + Date().toString().substring(4, 24) + "\r\n";
        data += linkUrls.join("\r\n") + "\r\n\r\n";
        writeFile(historyFile, data, true);
    }

    if (linkIds.length) removeLinks(linkIds);
}
__________________
Aktuelles Windows
Reply With Quote
  #82  
Old 01.12.2020, 13:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

Danke. Ich warte mal auf Antwort von mgpai, siehe https://board.jdownloader.org/showpo...postcount=1611
__________________
JD-Dev & Server-Admin
Reply With Quote
  #83  
Old 08.12.2020, 13:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Code:
/* 
    Disable duplicate link in Lingrabber
    Trigger required: A new link has been added
*/

var link = crawledLink;

if (link.availableState == "ONLINE") {
    var name = "history";
    var lock = getModifyLock(name);

    lock.writeLock();

    var urls = getProperty(name, true);

    if (urls == null) {
        try {
            var file = JD_HOME + "/cfg/history.txt";
            var urls = readFile(file);

            setProperty(name, urls, true);
        } catch (e) {}
    }

    lock.writeUnlock();

    if (urls) {
        var url = link.contentURL || link.pluginURL;

        if (link.host == "youtube.com") {
            url = link.containerURL;
        }

        if (urls.indexOf(url) > -1) {
            var text = "#duplicatelink";
            var comment = link.comment;

            if (comment) {
                text = text + " " + comment;
            }

            link.comment = text;
            link.enabled = false;
        }
    }
}
Reply With Quote
  #84  
Old 08.12.2020, 14:08
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 668
Default

Ach ja, ich glaube, das ist das Skript für das Problem des nicht abbrechbaren Linksammelns.

Thank you very much!
__________________
Aktuelles Windows
Reply With Quote
  #85  
Old 08.12.2020, 14:11
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 668
Default

This one has to be replaced with the new one(?):

__________________
Aktuelles Windows
Reply With Quote
  #86  
Old 08.12.2020, 14:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Dockel View Post
This one has to be replaced with the new one(?):
Yes.
Reply With Quote
  #87  
Old 08.12.2020, 14:26
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 668
Default

OK, many thanks!
__________________
Aktuelles Windows
Reply With Quote
  #88  
Old 08.12.2020, 14:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@mgpai: you also have to update all the other scripts to work with new inmemory list
__________________
JD-Dev & Server-Admin
Reply With Quote
  #89  
Old 08.12.2020, 14:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: you also have to update all the other scripts to work with new inmemory list
Only this script was causing high memory/cpu usagem due to the nature of the event trigger used. If any other script is causing a similar issue, I will look into it.
Reply With Quote
  #90  
Old 08.12.2020, 15:27
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@mgpai: but you need update the scripts that write/modify the history file as well to place changes list into property map. Else it will be read only once
__________________
JD-Dev & Server-Admin
Reply With Quote
  #91  
Old 08.12.2020, 15:50
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: but you need update the scripts that write/modify the history file as well to place changes list into property map. Else it will be read only once
There are many versions of the scripts which are scattered all over that thread. Some were modified in IRC, and those versions may not even be in the forum. I can only check if I know which script need to be modified.
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 23:37.
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.