|
[See Bugtracker] Skript oder sonst eine automatisierte Möglichkeit: Links nicht 1 weiteres Mal laden? |
|
Thread Tools | Display Modes |
#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 10: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 15: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? |
#141
|
|||
|
|||
Quote:
Quote:
__________________
Aktuelles Windows |
#142
|
|||
|
|||
Do you mean, the variant added via add links dialog or clipboard is disabled, but other variants of the same video, when added via context menu are not disabled?
|
#143
|
|||
|
|||
Sorry, I am not quite sure to understand. I want to avoid to download the same video again, independently of the version. Once I have download one of the offered versions, e.g. 720 p I never again want to download any version of that video, for example I do not want to download the 1080 p version or 480 p version and none of the others, I never want to download that video again. So because of that it would be good if all of those varaints (I chose one from to download) would be disabled / marked as dups because I never again want to download the same video independently of the variant.
__________________
Aktuelles Windows |
#144
|
|||
|
|||
For YT links, the script has been modified to match the video url and not the variant url, which means when you add YR links to JD, all variants of that video url, should automatically be disabed Is it not doing that?
|
#145
|
|||
|
|||
Ay, yes, indeed, it does it, I just tried. Didn't notice that before, sorry. That's extremely useful.
Thank you very much!
__________________
Aktuelles Windows |
#146
|
||||
|
||||
@mgpai: for YT videos, better process the properties, you can directly fetch the videoID via getProperty("YT_ID")
__________________
JD-Dev & Server-Admin |
#147
|
|||
|
|||
Since yesterday there are some links shown to be duplicates which (actually) cannot be duplicates.
Why could this happen? How could one avoid that?
__________________
Aktuelles Windows |
#148
|
|||
|
|||
Which site?
|
#149
|
|||
|
|||
Do you mean the hoster (zippy, anonfiles) or the website the links are from?
__________________
Aktuelles Windows |
#150
|
|||
|
|||
Quote:
I think you had requested to run dupe check on download list links. So, check if the url is present there. It obviously is matching some string from the history file or download list . You have to just find out which url is it matching and on which list. |
#151
|
|||
|
|||
Quote:
Quote:
Quote:
__________________
Aktuelles Windows |
#152
|
|||
|
|||
@Dockel: Please contact me in chat when you are free.
|
#153
|
|||
|
|||
Sorry, I do not know how to ping
__________________
Aktuelles Windows |
#154
|
|||
|
|||
Quote:
the app sorta hang up every time i add link when i enable the script. i can't click any option in the pop-up message, i can't close the app. i even have to force close it via task manager. can u help me pls? thanks Last edited by DragoBleaPiece; 31.01.2021 at 15:48. |
#155
|
|||
|
|||
Quote:
Solution: Disable "Synchronous Execution of script" checkbox in the top panel of the script editor. |
#156
|
|||
|
|||
Hello mgpai,
the same happens again with the same kind of links: https://board.jdownloader.org/showpo...&postcount=147 The links are not in history.txt.
__________________
Aktuelles Windows |
#157
|
|||
|
|||
Quote:
For testing purposes, temporarily replace the existing history file with an empty one and see if the link will still be marked as duplicate. You can also use the following script to find the matching entry (if any) in history file. Code:
/* Find matching entry for the selected link in history file Trigger required: Linkgrabber Contextmenu Button Pressed */ if (name = "Find in history") { var link = lgSelection.contextLink; var file = getPath(JD_HOME + "/cfg/history.txt"); var entries = readFile(file).split("\r\n"); var line = null; var url = link.contentURL || link.pluginURL; if (link.host == "youtube.com") { url = link.containerURL; } entries.some(function(entry, index) { if (entry == url) { line = index + 1; return true; } }) if (line) { alert("Found \"" + url + "\" on Line " + line + " in \"" + file + "\""); } else { alert("No matching entriy found for \"" + url + "\"."); } } To fix the issue, should be able to find the cause and reproduce the same outcome consistently. Contact me in chat after you run the tests. |
#158
|
|||
|
|||
Thank you!
I added four links which are marked as dupes. Did not find them in history.txt. Replaced that file, added those links again, they were marked as dupes: I added the script: I am in the chat now.
__________________
Aktuelles Windows |
#159
|
|||
|
|||
Summary?
Hello.
Thanks for thw ork to the problem. Can someone please put alle actual Scripts in one post (I'm a littlebit confused, what script is which one). Thank You. Bye, Christian |
#160
|
|||
|
|||
How could I avoid such messages?
How could I avoid such messages:
They show up when I add a file to the history.
__________________
Aktuelles Windows |
|
|