#3041
|
|||
|
|||
I have never seen such happen here. What settings does it?
Spoiler:
So after a reconnect is executed and the router / modem does not get an Internet connection JD automatically reconnects after a special time?
__________________
Aktuelles Windows Last edited by pspzockerscene; 29.10.2024 at 13:49. Reason: SPOILER Tag hinzugefügt |
#3042
|
||||
|
||||
I don't know but afik:
- It definitely tries multiple times - If you got the same IP after a reconnect, a retry will also be triggered If you want to discuss this topic in a deeper way, please open a new thread and describe your current problem. As script really shouldn't be needed in this case.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#3043
|
|||
|
|||
Quote:
Quote:
__________________
Aktuelles Windows |
#3044
|
|||
|
|||
Code:
/* generate "video_duration_formatted" property from "video_duration" property trigger: packagizer hook Enable "synchronous execution of script" checkbox in top panel */ if (linkcheckDone && state == "BEFORE") { var duration = link.getProperty("video_duration"); if (duration != null) { var fmt = function(n) { return ("0" + parseInt(n)).slice(-2); } var [seconds, milliseconds] = ("" + duration).split("."); var hours = fmt(seconds / 3600); seconds %= 3600; var minutes = fmt(seconds / 60); seconds = fmt(seconds % 60); milliseconds = ((milliseconds || "000") + "000").slice(0, 3); duration = ([hours, minutes, seconds].join(":") + "," + milliseconds) link.setProperty("video_duration_formatted", duration); } } Last edited by mgpai; 03.10.2024 at 08:10. |
#3045
|
|||
|
|||
[EventScripter] Downloadlist cleanup / Aufräumen der Downloadliste
[EventScripter] Downloadlist cleanup / Aufräumen
Eine Möglichkeit zum Aufräumen der Downloadliste wäre toll. Ich meine Einträge für die es keine Files mehr im Downloadordner mehr gibt zu löschen. Hat vielleicht schon so ein Script gesehen? **** A way to clean up the download list would be great. I mean deleting entries for which there are no more files in the download folder. Has anyone seen a script like this? Last edited by Fierro3612; 19.09.2024 at 23:00. |
#3046
|
|||
|
|||
That script is to add the metadata to the descriptions text file. Which field from the media metadata appears as in the OS file properties dialog?
|
#3047
|
|||
|
|||
Quote:
Code:
/* run external command on dowloaded file trigger : download finished */ if (link.finished) { var program = ["/path/to/myexternalprogram.exe"]; var parameters = ["paremeter1", "parameter2", "paremeter..."].join(","); var file = getPath(link.downloadPath); callSync(program, parameters, file); } Last edited by mgpai; 20.09.2024 at 20:23. |
#3048
|
|||
|
|||
Quote:
Code:
/* remove orphaned links trigger : jdownloader started */ getAllDownloadLinks().forEach(function(link) { link.finished && !getPath(link.downloadPath).exists() && link.remove(); }) |
#3049
|
|||
|
|||
Thank You very much
|
#3050
|
||||
|
||||
Quote:
I was away for some time and must have overlooked this. Now, thank you very, very much for your help. Will test the script probably this weekend and then let you know about the result. Best regards, Stefan |
#3051
|
||||
|
||||
Quote:
for 895,019 sec it returns 00:01:05,019 (incorrect) the correct result would be 00:14:55,019 (correct) Sent you an example link in a PM Thanks again for any efforts taken. BR Stefan |
#3053
|
||||
|
||||
Quote:
Three minor issues: 1. I'm getting a popup message "Alert message from MyScript@Packagizer Hook" for each digit group. Probably a leftover from your own tests? EDIT: Removed it myself... 2. Trailing zeroes are not shown: e.g. the script shows 00:03:25,6 instead of 00:03:25,600 (which I would prefer, if possible) 3. When there are no digits after the decimal separator e.g. 00:03:25,000, the script shows 00:03:25,undefined I would prefer ",000" if possible Last edited by StefanM; 01.10.2024 at 16:31. |
#3054
|
|||
|
|||
|
#3055
|
||||
|
||||
|
#3057
|
||||
|
||||
Working like a charm.
Thanks once again for the great work! I admire your skills. It was probably not that simple to write this script. |
#3058
|
|||
|
|||
Download Check in Kodi like folder setup
Hi.
I need some help with a little script what will check if i have the movie already before download. I have a base folder with 5-6000 movie folders. The movies are all starting with the DVD ID-Title-Year The movie folder has the same name as the movie. I need the script to check the section before the "-" Dash and after the "-" Dash before the "space". This way it docen't matter how many letters there is in the DVD-ID. example AARM-018 Best Of Thigh Job Threesomes (2021) Does this sound plausibel, than please let me know, i would really appreciate it. I am not sure if the script was already made but i could not find any thing like this. Thanks |
#3059
|
|||
|
|||
Check against what? file/folder name in download list?
|
#3060
|
|||
|
|||
It needs to check in download folder and any subfolders for any files with mp4 or mkv extension.
|
#3061
|
|||
|
|||
Can you make it ?
|
#3062
|
||||
|
||||
@mgpai
Where is the most recent version of the convert2mp3 script? I had a user in a ticket who seemed to have been using an older version. The bitrate calculation of that one caused it to fail. Seemingly old version: pastebin.com/raw/4wvQ3Hqz If that version is old: Where can I find your latest version? I've created a newer version compared to that one: - Do not overwrite mp3 target file if it already exists - Display human readable error messages - Added comments in English (I admit that I used chatGPT for this part, I was lazy). Newer version by me: pastebin.com/raw/PPb4G5DV
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#3063
|
|||
|
|||
Quote:
|
#3064
|
||||
|
||||
Thanks.
I'am not aware of any issues either. I just have a user in a ticket who claims that it sometimes randomly fails and then of course it gets disabled in JD. Most of my changes were done to auto add comments (for said user) and also I did not like the amount of indentation levels so I've refactored it to the "early return" principle.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#3065
|
|||
|
|||
Quote:
Thanks for jumping in. |
#3066
|
||||
|
||||
I've made him a german version with special error handling.
Again I don't think any of this is needed but I was in the mood to do this so I'll post it here too in case it's helpful for others: pastebin.com/raw/stqgZtm8 Please don't judge me for using ChatGPT - I've mainly used it for auto comment generation. The script is tested and working.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#3067
|
|||
|
|||
Quote:
ChatGPT can be quite useful. But those not familiar with JD API may find it confusing, since it tends to create scripts with non-existent APIs. |
#3068
|
||||
|
||||
:)
Quote:
For refactoring or adding comments though I need to say it works pretty well though I'd never trust it 100% and always perform tests.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#3069
|
||||
|
||||
@mgpai
Is there a simple script which downloads the comment of an item as same file name but with .txt extension? If so, where can I find that? If none exists, I will create one since I know that the demand is there.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download Last edited by pspzockerscene; 29.10.2024 at 10:14. |
#3070
|
|||
|
|||
Remeber creating one, but could not find it. Let me know if I can be of any help with the script.
|
#3071
|
||||
|
||||
Here is roughly what I want slahs what I would try to create (so far I didn't start).
A script that has the following features:
I want the code of this script to be in the script inside an extra function so we can easily do a "return early" thing to keep the structure flat so, similar to how the structure of the other script I posted is but without exceptions. It shouldn't be too complicated.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download Last edited by pspzockerscene; 29.10.2024 at 14:14. Reason: EDIT |
#3072
|
|||
|
|||
Code:
/* save comment to text file trigger : download finished */ var myHosts = ["soundcloud.com","audiocloud.com"]; var myExts = ["mp3", "jpg"]; var saveComment = function(link) { var finished = link.finished; if (!finished) { throw new Error("download not finished"); } var host = link.downloadHost; if (myHosts.indexOf(host) == -1) { throw new Error("host is excluded"); } var ext = getPath(link.downloadPath).extension; if (myExts.indexOf(ext) == -1) { throw new Error("extension is excluded"); } var comment = link.comment; if (!comment) { throw new Error("comment not found"); } var file = getPath(link.downloadPath.replace(/(.+)\..+/, "$1.txt")); if (file.exists()) { throw new Error("file already exists"); } try { writeFile(file, comment, false); } catch (e) {}; } saveComment(link); Let me know if anything is amiss. |
#3073
|
||||
|
||||
At the exact same time, I made my attempt lol
I'll just post it here for comparison:
Spoiler:
Code:
// Writes link comment to text file // Trigger: "A download has stopped" // Has some settings, just search for "settings" in this code // Main function that runs the script based on the early return principle function run() { // Early return if the download is not finished if (!link.isFinished()) { // console.log("Link is not yet downloaded"); return; } var comment = link.getComment(); // Retrieve the comment from the link // Early return if the comment is empty if (!comment) { return; } // Retrieve the link's file name and download folder path var fileName = link.name; var sourcePath = package.getDownloadFolder(); // "Settings", see vars down below // Define allowed file types (set to null or undefined to allow all types) var allowedFileTypes = null; // Example: set to null to allow all file types // var allowedFileTypes = [".mp3"]; // Option to overwrite existing files var overwriteExisting = false; // Set to true to overwrite existing files // Check if the file type is allowed (skip check if allowedFileTypes is null or undefined) if (allowedFileTypes && !allowedFileTypes.some(function(extension) { return fileName.endsWith(extension); })) { return; } // Change the file name to add ".txt" as the new extension var outputPath = sourcePath + "/" + fileName + ".txt"; // Early return if the file exists and overwriting is disabled if (!overwriteExisting && getPath(outputPath).exists()) { return; } // Write the comment to the file writeFile(outputPath, comment, true); } // Execute the run function run(); Pastebin: pastebin.com/raw/DcpjqF2f Before you ask: The reason I put all the code into a function is to be able to do "return;" instead of an exception since otherwise it won't compile in our framework. I guess your "inline function" would also allow a "return;". I'm not in the position to judge which one is "better"; I guess we'll make a merged one that contains all 'features'. EDIT Here is a merged version:
Spoiler:
Code:
// Writes link comment to text file // Trigger: "A download has stopped" // Has some settings, just search for "settings" in this code // Main function that runs the script based on the early return principle function run() { // "Settings", see vars down below // Define allowed file types (set to null or undefined to allow all types) var allowedFileTypes = null; // Example: set to null to allow all file types // var allowedFileTypes = [".mp3"]; // Option to overwrite existing files var overwriteExisting = false; // Set to true to overwrite existing files // Allowed hosts (only these hosts will proceed; set to null to allow all hosts) var myHosts = ["soundcloud.com", "audiocloud.com", "ping.online.net"]; // Early return if the download is not finished if (!link.isFinished()) { // console.log("Link is not yet downloaded"); return; } var comment = link.getComment(); // Retrieve the comment from the link // Early return if the comment is empty if (!comment) { return; } // Retrieve the link's file name, download folder path, and host var fileName = link.name; var sourcePath = package.getDownloadFolder(); var host = link.downloadHost; // Skip host check if myHosts is null or undefined if (myHosts && myHosts.indexOf(host) === -1) { return; } // Skip file type check if allowedFileTypes is null or undefined var fileExtension = fileName.split('.').pop(); if (allowedFileTypes && allowedFileTypes.indexOf(fileExtension) === -1) { return; } // Change the file name to add ".txt" as the new extension var outputPath = sourcePath + "/" + fileName + ".txt"; // Early return if the file exists and overwriting is disabled if (!overwriteExisting && getPath(outputPath).exists()) { return; } // Write the comment to the file writeFile(outputPath, comment, true); } // Execute the run function run(); I liked your "inline function" more since it eliminates one indentation.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download Last edited by pspzockerscene; 29.10.2024 at 14:11. |
#3074
|
|||
|
|||
Quote:
Quote:
Quote:
Code:
(function() { if (!link.finished) { return; } alert(link.name); })(); |
#3075
|
||||
|
||||
Quote:
Code:
if (!link.isFinished()) { return; } Code:
function run() { if (!link.isFinished()) { return; } } run(); I've never really delt much with js. I mostly read all of the js related memes on reddit lol
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
Thread Tools | |
Display Modes | |
|
|