#41
|
|||
|
|||
How to suppress dialogs?
How do I suppress and auto-OK dialogs like this one:
"You are trying to add links that are already in your download list" (Yes, i do) |
#42
|
||||
|
||||
You have to change value in Settings-Advanced Settings-LinkgrabberSettings.defaultonaddeddupeslinksaction
LinkgrabberSettings.handledupesonconfirmlatestselection
__________________
JD-Dev & Server-Admin |
#43
|
|||
|
|||
Thanks, that worked!
Now I have another annoying dialog to deal with: Event Scripter permissions required! [...]The script tries to call the remote API[...] The window has a checkbox in the lower left ("Don't show this again") but keeps popping up. I crawled through the "advanced settings" and could not find a solution. |
#44
|
||||
|
||||
The question dialog will show up for each api method once/script. You can use the *don't show again* checkbox.
At the moment there is no generic *disable permission dialogs*
__________________
JD-Dev & Server-Admin |
#45
|
|||
|
|||
Again, thanks for you answer!
I am working on a script that checks the recording of an audio-stream - the api calls are only made when there is an interruption in that stream. My script is intended to work even when I am not in front of the computer and it already works quite well. Of course, my script does not work AT ALL when those dialogs pop up and wait for confirmation. You said "the question dialog will show up for each api method once/script"... does that mean, I cannot even make dummy-calls to all needed api methods when jDownloader starts ("JDownloader started"), because that would be from a different script? Uh...that is very bad news! It would be very helpful being able to set the properties of a certain script to "permanently disable all permission dialogs". As a side note: The examples shown here were very helpful to me. My questions as a newbie seem basic, I was searching for their answers via google and could only find single messages between different topics. is there an "event scripter discussion page/forum"? |
#46
|
||||
|
||||
JDownloader asks permission for every api call or file access. You don't want to import a script from someone without checking it and voila, it sends personal data to somewhere else and then formats your computer That's why you have to *agree* every such action and there is a *don't show again' checkbox. I will add a script based *grant all* checkbox soon.
There is no specific thread for eventscripter Just open new thread and ask. You may also contact mgpai, he is very talented, a true eventscript master
__________________
JD-Dev & Server-Admin |
#47
|
|||
|
|||
Could someone give me an example on how I would go about adding self crawled links to the Link Grabber results?
The basic idea is to work around where there's no plugin for a site so I can write a script instead that goes through there and finds them. I know enough JS for that and I found the right trigger that gets fired when you copy a link with clipboard monitoring. The only thing I don't know is how to package them up and add them to the list : / Probably with callAPI() I guess? |
#48
|
|||
|
|||
Have you tried creating 'linkcrawler rules'? It can be used to automatically grab links from sites which do not have dedicated plugins. You can find example rules in the forum.
If you wish to add links using event scripter, you can use my.jdownloader API call Code:
callAPI("linkgrabberv2", "addLinks", {AddLinksQueryStorable}); Code:
callAPI("linkgrabberv2", "addLinks", { "links": "https://board.jdownloader.org/images/logo.png http://jdownloader.org/lib/tpl/arctic/images/logo.png", "packageName": "Jdownloader Images" }) Code:
**External links are only visible to Support Staff** |
#49
|
|||
|
|||
Quote:
I'll try both though, if I can remember which site I needed it for... But I'm happy that I now have the means to finally get around that if I encounter it again, it bothered me so much in the past :x |
#50
|
|||
|
|||
LINK NAME CLEANER (auto)
Hi,
Here is a script to help you to auto clean/format filename during the link grabbing process. This is done automatically in background for each added link. You can set some options at the top of the script. This is useful in any case as soon as you notice a recurring pattern in your filenames that you'll want to get rid of or format. if you set custom filename for video files such as: Code:
[*CHANNEL*] (*PLAYLIST_NAME* *PLAYLIST_POSITION[00]*) *DATE[YY.MM.dd]* - *VIDEO_NAME*.*EXT* Code:
[Any Youtuber Channel] ( ) 17.03.11 - Video Title Code:
[Any Youtuber Channel] 17.03.11 - Video Title Code:
// LINK NAME CLEANER (auto) // Trigger required: Packagizer Hook // Version 2017.11.14 /* ************************************************************************* Set the characters that will be removed from both ends of the filename. Be sure to double escape special chars such as "\\s" instead of "\s". ****************************************************************************/ var leadAndTrailTrimChars = "\\s-_"; /* ************************************************************************* Set the characters that will be replaced with whitespace. Be sure to double escape special chars such as "\\s" instead of "\s". ****************************************************************************/ var charToSpace = "_"; /* ************************************************************************* Set the words or phrases to remove. Words/phrases must be separated with | such as "word one|word two|word three" Be sure to double escape special chars such as "\\s" instead of "\s". ****************************************************************************/ var wordsToRemove = "avec sous-titres"; /***************************************************************************/ if (linkcheckDone) { /* =========================== INITIALIZE ============================ */ var myPackagizerLink = link; var fileName = myPackagizerLink.getName(); var re, ext; // Remove the extension from the end and save it for later. // And make it lower case at the same time. ext = fileName.slice((fileName.lastIndexOf(".") - 1 >>> 0) + 2); if (ext !== "") { ext = "." + ext.toLowerCase(); } // If extension exists, then we will work with the filename without extension fileName = fileName.substr(0, (fileName.length - ext.length)); /* ========================= REGEX PATTERNS ========================== */ // Remove these words/phrase : wordsToRemove re = new RegExp("\\b(?:" + wordsToRemove + ")\\b", "gi"); fileName = fileName.replace(re, ""); // Replace these characters with whitespace : charToSpace re = new RegExp("[" + charToSpace + "]", "gi"); fileName = fileName.replace(re, " "); // Delete empty bracket content. "( )", "[ ]" or "{ }" will be removed from filename. re = new RegExp("(\\(\\s+?\\))|(\\[\\s+?\\])|({\\s+?})", "gi"); fileName = fileName.replace(re, ""); /* ====== ALWAYS APPLY NEXT REPLACEMENTS AT THE END OF PROCESS ======= */ // Replace & with & re = new RegExp("&", "gi"); fileName = fileName.replace(re, "&"); // Remove unwanted characters from both ends of the filename re = new RegExp("^[" + leadAndTrailTrimChars + "]*(.+?)[" + leadAndTrailTrimChars + "]*$", "gi"); fileName = fileName.replace(re, "$1"); // Replace multiple spaces with only one re = new RegExp("\\s\\s+", "gi"); fileName = fileName.replace(re, " "); // Removes whitespace from both ends of the filename (just to be sure) fileName = fileName.trim(); /* ====== APPLY NEW FILE NAME ======= */ myPackagizerLink.setName(fileName + ext); } Last edited by fred_gaou; 14.11.2017 at 22:42. Reason: bug fix |
#51
|
|||
|
|||
1) How to set comments based on filenames in downloadlist context menu before starting package download
2) How to set filenames based on comments after finished downloading the links I have a lot of links that change their name once the download starts and I want to keep them. |
#52
|
|||
|
|||
hi i look for a script that start my downloads maybe at 9pm and disable if not finished with downloads at 6 am
|
#53
|
||||
|
||||
@userking
no need for event scripter, use the scheduler. That's its intended purpose.
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#54
|
|||
|
|||
Quote:
Please provide example links of hosts where this happens. If it is plugin issue, the developers might be able to look into it. If the ideal solution happens to be a script, I will be happy to help you with it. |
#55
|
|||
|
|||
Turned out to be the same problem with the host that I also have reported. Since they were old links I did not think it had anything to do.
Although if is not a lot of work for you I'm still interested in the way a script could handle this situation. It would be helpful to learn and perhaps use for other situations in the future. Thanks in advance mgpai |
#56
|
|||
|
|||
Please PM some example links to me.
|
#57
|
|||
|
|||
Like I said, now, the problem doesn't exist anymore. When I start the downloads the names remain like it should. But before that, with the attached version of the hoster plugin the names change.
1) Add the links with current version **External links are only visible to Support Staff****External links are only visible to Support Staff** **External links are only visible to Support Staff****External links are only visible to Support Staff** **External links are only visible to Support Staff****External links are only visible to Support Staff** **External links are only visible to Support Staff****External links are only visible to Support Staff** **External links are only visible to Support Staff****External links are only visible to Support Staff** **External links are only visible to Support Staff****External links are only visible to Support Staff** 2) Close the program and change the hoster plugin in order to reproduce the behaviour 3) Restart and then start the downloads or check online availability and now the filenames are changed to 2496786.mp3 2496802.mp3 2496828.mp3 17511121.mp3 17458463.mp3 17364599.mp3 If this was the situation it's easy to rename six files, but for 70-80 per package... So, if it happens again, I thought copy the "desired" filenames to the comment field and when the downloads are finished rename them, the whole package, using that information. E.g.: Filename: La nit de l'ornitorinc 291013 (1 de 3).mp3 Comment: copy filename to comment Filename: La nit de l'ornitorinc 291013 (1 de 3).mp3 Comment: La nit de l'ornitorinc 291013 (1 de 3).mp3 After download Filename: 2496786.mp3 Comment: La nit de l'ornitorinc 291013 (1 de 3).mp3 copy comment to filename Filename: La nit de l'ornitorinc 291013 (1 de 3).mp3 Comment: La nit de l'ornitorinc 291013 (1 de 3).mp3 |
#58
|
|||
|
|||
@infkeops,
Code:
// Set filename as comment // Trigger: "Packagizer Hook" if (link.getHost() == "ivoox.com") { link.setComment(link.getName()); } Code:
// Set comment as file name // Trigger: "A Download Stopped" if (link.isFinished() && link.getHost() == "ivoox.com" && link.getName() != link.getComment()) { link.setName(link.getComment()); } |
#59
|
|||
|
|||
Quote:
like say one link is downloading at 128kb\s leave that alone, but if another is downloading at 50kb/s have it stopped and then started. |
#60
|
|||
|
|||
Quote:
Code:
// Stop and restart slow links. // Trigger Required: "Interval" (Recommended: 30000 or more). // IMPORTANT: Enable "Synchronous execution of script" (checkbox). var minSpeed = 128; // (KiB/s) <- minimum download speed per link. var minDuration = 1; // (minutes) <- minimum download duration per link. var links = getRunningDownloadLinks(); for (i = 0; i < links.length; i++) { var link = links[i]; if (link.getDownloadDuration() < minDuration * 60 * 1000) continue; if (link.getSpeed() > minSpeed * 1024) continue; link.abort(); } |
#61
|
|||
|
|||
Quote:
|
#62
|
|||
|
|||
Quote:
|
#63
|
|||
|
|||
so its not possible to stop the download of individual links and wait?
|
#64
|
|||
|
|||
Not out of the box. This script should work just fine, so I am not sure if any other solution will be worth the effort.
|
#65
|
|||
|
|||
Quote:
its probably something that only i would use so i can see that it might not be worth the effort, thanks anyway though. Last edited by Tyler; 29.03.2017 at 11:23. |
#66
|
|||
|
|||
Quote:
Code:
// Skip slow links and resume them after wait time. // Trigger Required: "Interval" (Recommended: 30000 or more). // IMPORTANT: Enable "Synchronous execution of script" (checkbox). var minSpeed = 128; // (KiB/s) <- minimum download speed per link. var minDuration = 1; // (minutes) <- minimum download duration per link. var waitTime = 5; // (minutes) <- wait time before restart var links = getRunningDownloadLinks(); var skipped = []; for (i = 0; i < links.length; i++) { var link = links[i]; if (link.getDownloadDuration() < minDuration * 60 * 1000) continue; if (link.getSpeed() > minSpeed * 1024) continue; link.setSkipped(true); skipped.push(link.getUUID()); } if (skipped.length > 0) { sleep(waitTime * 60 * 1000); resumeLinks(); } //functions function resumeLinks() { callAPI("downloadsV2", "resumeLinks", skipped, []); while (isDownloadControllerStopping()) sleep(1000); if (!isDownloadControllerRunning()) startDownloads(); } |
#67
|
|||
|
|||
seems to just be setting the download to skip and starting another one.
maybe it needs to also change the simultaneous downloads from 2 to 1 during the sleep? Last edited by Tyler; 29.03.2017 at 15:37. |
#68
|
|||
|
|||
Does it stay 'skipped' even after the wait time? It will try to resume/restart the download immediately after the 'wait time'. But it can do so only if free slot is available.
|
#69
|
|||
|
|||
yeah the skipped goes away but its still starting more downloads instead of just stopping the one link.
|
#70
|
|||
|
|||
If a download slot is free and there are pending downloads in the list, new downloads will naturally start. This will be the case, not only with the script, but even when you stop/skip the link manually. It is less likely to happen if 'abort()' method used, because it tries to download the same link immediately.
|
#71
|
|||
|
|||
i know but i don't need new downloads to start, i just need the individual link that is slowed to stop.
|
#72
|
|||
|
|||
Hey guys,
maybe this is the wrong place, but i cant find a how to for call skript from event handler on my synology nas. Is there something in the forum? Thank you guys |
#73
|
||||
|
||||
Install the Eventscript Extension via Webinterface in Settings. Then restart JDownloader.
Then easiest way to write script is by using a JDownloader with GUI, write your script there and finally copy over the value from settings-advanced settings-EventScripter.scripts to your other JDownloader In case you need help with eventscripter, I suggest to ask mgpai for help
__________________
JD-Dev & Server-Admin |
#74
|
|||
|
|||
Thank you Jiaz,
it works now so far, thank you. But i have a Problem, i want to get the diretory Name of the extracted folder. package.getName(); Works on my Laptop example : pictures2016 the same package on my nas gives me the value: VARIOUS |
#75
|
||||
|
||||
Don't use package.getName as it returns the package name and not the extracted folder.
Better use *Archive extraction finished* and make use of archive information. there you an access the 'extract to' folder package name depends on settings/packagizer rules/various package settings and many more. You can ask mgpai for help with eventscripter.
__________________
JD-Dev & Server-Admin |
#76
|
|||
|
|||
Hi! Is there a way i can access the plugins data? I would like to set a stopmark when captcha solver queue is high.
Thanks! |
#77
|
||||
|
||||
plugins do not have data in that fashion.
they are just methods to perform tasks. what you're trying todo is more complicated than you realise. How are you going to measure this, one could assume it should be done at the ces provider level then set a global stop mark and when loads reduce, remove said stopmark.
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#78
|
||||
|
||||
What exactly do you mean by *captcha solver queue* is high?
captcha solver queue max contains number of concurrent downloads + linkcrawler tasks. so while downloading it can max contain 20 jobs....
__________________
JD-Dev & Server-Admin |
#79
|
|||
|
|||
Quote:
Quote:
Thanks raztoki and Jiaz!! :thumbup: |
#80
|
||||
|
||||
I will check next week and provide feedback here
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|