#81
|
|||
|
|||
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 |
#82
|
||||
|
||||
Danke. Ich warte mal auf Antwort von mgpai, siehe https://board.jdownloader.org/showpo...postcount=1611
__________________
JD-Dev & Server-Admin |
#83
|
|||
|
|||
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; } } } |
#84
|
|||
|
|||
Ach ja, ich glaube, das ist das Skript für das Problem des nicht abbrechbaren Linksammelns.
Thank you very much!
__________________
Aktuelles Windows |
#85
|
|||
|
|||
This one has to be replaced with the new one(?):
__________________
Aktuelles Windows |
#86
|
|||
|
|||
|
#87
|
|||
|
|||
OK, many thanks!
__________________
Aktuelles Windows |
#88
|
||||
|
||||
@mgpai: you also have to update all the other scripts to work with new inmemory list
__________________
JD-Dev & Server-Admin |
#89
|
|||
|
|||
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.
|
#90
|
||||
|
||||
@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 |
#91
|
|||
|
|||
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.
|
Thread Tools | |
Display Modes | |
|
|