@georgegalily
Please try this one
Code:
if (state == "AFTER") {
var url = link.getURL();
var historyFile = getPath(JD_HOME + "/cfg/history.txt");
var lock = getModifyLock("history");
var isDuplicate = false;
lock.writeLock();
try {
var history = historyFile.exists() ? readFile(historyFile) : "";
isDuplicate = history.indexOf(url) > -1;
history = null;
} finally {
lock.writeUnlock();
}
if (isDuplicate) {
var text = "#duplicatelink";
var comment = link.getComment();
comment = comment ? text + " " + comment : text;
link.setComment(comment);
sleep(1000);
link.getCrawledLink().remove();
}
}
__________________
JD-Dev & Server-Admin
Last edited by Jiaz; 07.10.2022 at 18:57.
|