#121
|
|||
|
|||
Quote:
Quote:
Many thanks for the script!
__________________
Aktuelles Windows |
#122
|
|||
|
|||
From what I can see, the links are disabled only in linkgrabber tab. In downloads tab, they are skipped, not disabled.
Can you number the scripts in your post? I will then tell you which script I think is used to skip/enable the link. You can then test with only that script enabled and see if the issue can be reproduced. |
#123
|
|||
|
|||
Quote:
Quote:
Quote:
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; } } } Code:
// Skip link if it present in download history (has "#duplicatelink" in comment) // To download the file (prevent skipping), remove "#duplicatelink" from comment // Trigger required: A Download Started var comment = link.getComment() || ""; if (comment.indexOf("#duplicatelink") > -1) { // var url = link.getContentURL() || link.getPluginURL(); // Nur tatsächlich runtergeladene Varianten von YouTube werden als Duplikate behandelt var url = link.getHost() == "youtube.com" ? link.getContainerURL() : link.getContentURL() || link.getPluginURL(); // alle Varianten auf YouTube werden als Duplikate behandelt link.setEnabled(false); //To disable the link instead of skipping it, replace link.setSkipped(true); with link.setEnabled(false); in both the scripts alert("Download Skipped: \"" + url + "\" is present in history file."); }
__________________
Aktuelles Windows |
#124
|
|||
|
|||
At the moment there are no dups disabled / find anymore.
__________________
Aktuelles Windows |
#125
|
|||
|
|||
@Dockel: Can you please contact me in JD Chat?
|
#126
|
|||
|
|||
Yes, I just did.
__________________
Aktuelles Windows |
#127
|
||||
|
||||
Quote:
Your modified script reads file from disk once and then continue to use highspeed in memory list. The other scripts however still read/write from disk and thus the changes are not visible to the in memory list.
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 10.12.2020 at 11:01. |
#128
|
|||
|
|||
Jiaz, can one get a sound alert with new messages in the JD chat in JD?
__________________
Aktuelles Windows |
#129
|
||||
|
||||
@Docker: The chat extension is very minimalistic and to be honest, if you're using chat that much you better stick with a real IRC client instead.
__________________
JD-Dev & Server-Admin |
#130
|
|||
|
|||
OK, mache ich, danke.
__________________
Aktuelles Windows |
#131
|
||||
|
||||
Danke fürs Verständnis!
__________________
JD-Dev & Server-Admin |
#132
|
|||
|
|||
Quote:
|
#133
|
|||
|
|||
Replacement scripts
Script #1 Code:
/* Move selected links from linkgrabber list to history file Trigger 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 file = getPath(JD_HOME + "/cfg/history.txt"); var lock = getModifyLock(file.name); lock.writeLock(); var urls = getProperty(file.name,true) || file.exists() && readFile(file) || ""; var unique = ""; lgSelection.getLinks().forEach(function(link) { if (link.availableState == "ONLINE") { var url = link.contentURL || link.pluginURL; if (urls.indexOf(url) == -1) { unique += url + "\r\n"; } link.remove(); } }) if (unique) { writeFile(file, unique + "\r\n", true); } setProperty(file.name, urls += unique, true); lock.writeUnlock(); } Script #2 Code:
/* Move selected links from download list to history file / Disable corresponding links in linkgrabber list Trigger required: Downloadlist 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 file = getPath(JD_HOME + "/cfg/history.txt"); var lock = getModifyLock(file.name); lock.writeLock(); var urls = getProperty(file.name, true) || file.exists() && readFile(file) || ""; var unique = ""; dlSelection.getLinks().forEach(function(link) { if (link.finished) { var url = link.contentURL || link.pluginURL; if (urls.indexOf(url) == -1) { unique += url + "\r\n"; } link.remove(); } }) if (unique) { writeFile(file, unique + "\r\n", true); } setProperty(file.name, urls += unique, true); lock.writeUnlock(); getAllCrawledLinks().forEach(function(link) { if (link.availableState == "ONLINE") { 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; } } }); } Script #3 Code:
/* Disable duplicate link in Lingrabber list Trigger required: A new link has been added */ var link = crawledLink; if (link.availableState == "ONLINE") { var file = getPath(JD_HOME + "/cfg/history.txt"); var lock = getModifyLock(file.name); lock.writeLock(); var urls = getProperty(file.name, true); if (urls == null) { urls = file.exists() && readFile(file) || ""; setProperty(file.name, urls, true); } 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; } } } Last edited by mgpai; 10.12.2020 at 16:38. Reason: Modified all 3 scripts. |
#134
|
|||
|
|||
Are the scripts numerated like mine are? If not, I would have done a mistake, I guess.
And scripts 4 and 5 stay like they are, I assume.
__________________
Aktuelles Windows |
#135
|
||||
|
||||
@Dockel: Wait for updated scripts
@mgpai: contact me in chat, your script modification doesn't make sense You misunderstood me
__________________
JD-Dev & Server-Admin |
#136
|
|||
|
|||
Quote:
I don't see you online in IRC. |
#137
|
||||
|
||||
@mgpai
Quote:
__________________
JD-Dev & Server-Admin |
#138
|
|||
|
|||
All done, seems to work fine, tried some links. Many thanks!
Is there a way to mark / disable all the different video versions when loading a special video version only from YouTube? E.g. I download this one and all of the other versions automatically are disabled / marked as dups as well:
__________________
Aktuelles Windows |
#139
|
||||
|
||||
@Dockel: Needs a script that looks for other variants of same videoID @mgpai
__________________
JD-Dev & Server-Admin |
#140
|
|||
|
|||
@dockel: All 3 new scripts needed to be updated. Please replace your existing scripts with the latest version.
You mean if there are multiple variants in the list, select one you want and disable the other variants? |
Thread Tools | |
Display Modes | |
|
|