|
[See Bugtracker] Skript oder sonst eine automatisierte Möglichkeit: Links nicht 1 weiteres Mal laden? |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Skript oder sonst eine automatisierte Möglichkeit: Links nicht 1 weiteres Mal laden?
Gibt es ein Skript oder sonst eine automatisierte Möglichkeit, zu vermeiden, dass Links, deren Dateien JD schon irgendwann einmal (in den letzten Jahren) runtergeladen hat, nicht noch einmal ruterlädt?
|
#2
|
||||
|
||||
Ticket:
Wie du siehst ist das Ticket bereits 10 Jahre alt und eine (zeitnahe) Umsetzung daher extrem unwahrscheinlich. Zudem wird dein Vorhaben zusätzlich schwierig, denn: - Anhand welcher Merkmale willst du erkennen, was du bereits heruntergeladen hast? Nur über die Links abzugleichen wäre natürlich am einfachsten - Sollen auch offline Links berücksichtigt werden? - Abgleich über Hashes der Dateien? - Die heruntergeladenen Daten sind meist nicht mehr vorhanden (entpackte- und gelöschte Archive) - Über die Dateinamenabgleichen? Aber neue Dateien könnten theoretisch gleich heißen aber einen anderen Inhalt haben Du siehst das wird nicht einfach und ist nicht mal eben schnell erledige bzw. überhaupt möglich. Um aktuell überhaupt anfangen zu können, geladene Links, Dateinamen usw. zu speichern müsstest du entweder über die myjd API gehen oder dir ein EventScripter Script schreiben. Selbst wenn das verlinkte Ticket erledigt wäre, würde das nicht ausreichen um dein Ziel zuverlässig zu erreichen Grüße, psp
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#3
|
|||||
|
|||||
Ups, so alt schon.
Irgendwo hier gab es die gleiche Frage auch, glaube, jemand wollte vielleicht ein Skript machen, kann ich aber nicht mehr finden. Quote:
Quote:
Quote:
Quote:
Quote:
|
#4
|
|||||
|
|||||
Quote:
Notfalls den EventScripter Thread durchforsten und/oder den User mgpai fragen er hat schon viele Scripte geschrieben und daher die beste Übersicht: https://board.jdownloader.org/member.php?u=73437 Quote:
Quote:
Quote:
Quote:
... über die Zeit haben zwar einige User soetwas angefragt, aber ich kann mir nicht vorstellen, dass es jemans umgesetzt werden wird also mach' dir besser keine falschen Hoffnungen oder setze es einfach selbst um. Grüße, psp
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#5
|
|||
|
|||
Danke für den Link.
Quote:
Tja, dann sollte man also wohl besser ausfpassen beim Runterladen um Duplikate zu vermeiden. Werde trotzdem mal mgpai fragen. Als letzten Versuch. |
#6
|
||||
|
||||
Gerne.
Quote:
Quote:
Grüße, psp
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#7
|
|||
|
|||
Quote:
Quote:
|
#8
|
||||
|
||||
Braucht er nicht aktiv es sind Backups.
Ja.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#9
|
|||
|
|||
Quote:
|
#10
|
||||
|
||||
Quote:
Brauchst du falls deine Downliadliste/Linkgrabber Liste aus irgendeinem Grund kaputtgeht. Weil JD viele Einstellungsmöglichkeiten hat. EDIT Siehe: https://board.jdownloader.org/showpo...2&postcount=17 Quote:
Grüße, psp
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download Last edited by pspzockerscene; 05.02.2020 at 15:37. Reason: Verlinkung ergänzt |
#11
|
|||
|
|||
Hmmm, tja, sehr verwirrend. Aber auf jeden Fall nicht nutzbar für so ein Skript also oder zur Nutzung der (alten) Links.
OK, vielen Dank! |
#12
|
|||
|
|||
Die Backups liegen aber doch nicht in cfg/archives. Dort finde ich nur ein paar JSON-Dateien.
|
#13
|
|||
|
|||
Ja, stimmt, die Backup-Dateien sind im Ordner cfg. Im Ordner archives sind hier fast 28.000 json-Dateien.
|
#14
|
|||
|
|||
downloadListXXX.zip.backup dürften zudem kaputte Listen sein.
|
#15
|
|||
|
|||
Wie kommt denn das?
|
#18
|
|||
|
|||
Quote:
Default location of history file: "<JDownloader folder>\cfg\history.txt" Move selected download links to history file: 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); } Move selected linkgrabber lnks to history file: 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); } Detect/mark duplicate files when they are added to the linkgrabber tab: Code:
// If download link is present in history file, mark it as duplicae (add "#duplicatelink" to comment) // Trigger required: Packagizer Hook if (state == "AFTER") { var url = link.getURL(); var historyFile = getPath(JD_HOME + "/cfg/history.txt"); var history = historyFile.exists() ? readFile(historyFile) : ""; if (history.indexOf(url) > -1) { var text = "#duplicatelink"; var comment = link.getComment(); comment = comment ? text + " " + comment : text; link.setComment(comment); } } Skip duplicate links on download start: 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(); link.setSkipped(true); alert("Download Skipped: \"" + url + "\" is present in history file."); } |
#19
|
|||
|
|||
Quote:
|
#20
|
|||
|
|||
Extremely fast done, thank you very much!
So one somehow has to add each single script to a new item in the event scripter, I assume. And to give the items a name and do anything else? |
#21
|
|||
|
|||
Quote:
Configure:
Use:
If you need any help setting it up, you can also find me in JD Chat: Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader Last edited by mgpai; 05.02.2020 at 19:17. Reason: Corrected the webchat link. |
#22
|
|||
|
|||
It looks like that now:
So there are to context menu items to be customized, if I see it right. By clicking the cross in the left bottom corner, I assume(?): From to I assume, that is done wrongly. Do not know how to to it rightly. I clicked "allow" here: Quote:
The JD Chat, thank you, is it more useful than doing it here? Can images be used there? |
#23
|
|||
|
|||
The checkboxes (first column) have been enabled. From the screenshot everything appears to be ok.
For security purposes, on first run, JD will request your permission to execute the script. You can safely click OK for own/known scripts. You can also change button names (for e.g. use native language). Just make sure that you use the same names in script as well as context menu. Can do the same with comment. It can be also used in the search bar to filter/view duplicate links. It is suitable for technical assistance, since you don't have to wait between replies. Sharing image/file links are also permitted. |
#24
|
|||
|
|||
Quote:
Code:
// Skip download link, if filename exists in the user-spcified list // To download the file (prevent skipping), remove "#duplicatefile" from comment // Trigger required: A Download Started var fileNamesList = "c:/myFolder/fileslist.txt"; // < Set path to text file which contain the file names. Use "\\" or "/" as path separators. var dupeFilecheck = link.getProperty("dupeFileCheck"); var linkName = link.getName(); var comment = link.getComment() || ""; var skipLink = function() { link.setSkipped(true); alert("Download Skipped: File \"" + linkName + "\" is present in files list."); } if (dupeFilecheck) { if (comment.indexOf("#duplicatefile") > -1) skipLink(); } else { var fileNames = readFile(getPath(fileNamesList)).trim().split("\r\n"); fileNames.some(function(fileName) { if (linkName == fileName.trim()) { var text = "#duplicatefile"; comment = comment ? text + " " + comment : text; link.setComment(comment); skipLink(); return true; } }) link.setProperty("dupeFileCheck", true); } I've quoted parts of text from your email for reference, without your permission. Hope it's OK. Last edited by mgpai; 10.02.2020 at 07:00. Reason: Modified script to remove leading and trailing spaces from 'fileName' |
#25
|
|||
|
|||
Yes, yes, of course.
So a new script for a new item in JD, many thanks! So it looks like this now: |
#26
|
|||
|
|||
I have added the path to the txt file containing the downloaded files in the new script:
I:\jD-Downloads\dummies.txt The files contained in the txt files look like this: Last edited by Fetter Biff; 08.02.2020 at 09:10. |
#27
|
|||
|
|||
Quote:
Slash character is missing from file path, since it was not escaped. Set it as specified in the script. Code:
Set path to text file which contain the file names. Use "\\" or "/" as path separators. Code:
"I:\jD-Downloads\dummies.txt" Code:
"I:\\jD-Downloads\\dummies.txt" Code:
"I:/jD-Downloads/dummies.txt" |
#29
|
||||
|
||||
Woow mgpai I'm impressed!
-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#30
|
|||
|
|||
Quote:
Quote:
|
#31
|
|||
|
|||
@psp: Happy to be of any help.
Quote:
|
#32
|
|||
|
|||
Quote:
It seems here is no conncetion: **External links are only visible to Support Staff****External links are only visible to Support Staff** How do I have to add the "Move to history" button? |
#33
|
|||
|
|||
Quote:
Quote:
Quote:
Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader OR you can also install/enable/use the built-in chat extension in JD. It also connects to the same channel. Feel free to join me in chat. I am currently online there. |
#34
|
||||
|
||||
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#35
|
|||
|
|||
Vielen Dank, hat geklappt
|
#36
|
|||
|
|||
How could I add links to the history in the download list window when they are not downloaded (completely) or links without beginning downloading them?
|
#37
|
|||
|
|||
Either wait for the download to finish, or if you do no intend to download the file, use "Mark as finished" context menu command (customize menu to add it) to abort/cancel the download and then add it to history.
|
#38
|
|||
|
|||
Alright, thank you very much!
|
#39
|
|||
|
|||
Is it possible to show only one message for all of the skipped downloads respectively to show the downloads in a single message or to have an option to not to show a skipped message at all?
JD gets the focus / comes on top each time a message is shown. So if there are many skipped downloads it is quite inconvenient to e.g. use another program. And to close the messages is a little inconvenient as well. And each time JD is restarted with the same links in the download list the same messages for the same downloads occur again. Can one somehow avoid that? Last edited by Fetter Biff; 09.02.2020 at 10:30. |
#40
|
|||
|
|||
Quote:
You can delete the following line or comment it (Add "//" at the beginning of that line) out to prevent the message from being displayed: Current: Code:
alert("Download Skipped: \"" + url + "\" is present in history file."); Code:
// alert("Download Skipped: \"" + url + "\" is present in history file."); You can do it in both link check and file check scripts. Quote:
To avoid dupe checking everytime you start JD, remove the "#duplicatelink" or "#duplicatefile" from the comment (if you are plannig to redownload the file) or delete it from the list (if you don't intend to download it again). |
|
|