JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2281  
Old 10.06.2022, 17:56
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 491
Default

Quote:
Originally Posted by Jiaz View Post
those are placeholder for the "Copy information* and has nothing to do with scripts for Eventscripter. There you have access to the number and have to convert to human readable string by yourself
those placeholder is formatted filesize in different units
Yes, but you said before
Quote:
Originally Posted by Jiaz
for example? The ones from "Copy Information" coincidentally sound the same.
and I just replied "No"...
(I meant, that they don't sound the same)
Reply With Quote
  #2282  
Old 10.06.2022, 18:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

Quote:
Originally Posted by StefanM View Post
I meant, that they don't sound the same
Because I thought you were looking for those placeholder within the eventscripter script. and that they sound *the same* between scripts and *Copy information* and yet not available
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2283  
Old 10.06.2022, 18:15
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 491
Default

Quote:
Originally Posted by pspzockerscene View Post
And?
Why would you read the "Add custom EventScripter buttons" article first without even knowing what the EventScripter is?..
Hey!!!
No need to shout at me.

A user (like me) possibly - but not necessarily - would have read the first article. But you cannot assume that! In fact I read it a few days before. And then some other day I read the article I was referring to in my post. And yes, I did not have Script Eventer installed.

I can look back on decades of experience with customers, as any complaints about our technical support finally ended up on my desk.

Please believe me, when I say, that you cannot assume that a user would read both articles. Nor can you assume that they would read both of them on the same occasion.

Of course there is no need to rewrite everything in every article. But a reference "Please make sure that you have Script Eventer Extension installed as described here..." does make sense.

You are sharing a lot of your experience with me and other users here. And you are doing a great job!

I just wanted to share some of my experience with you, to help you, to give you at least something back. That's all.


Just take a lot at some User's Manuals, maybe of your TV, your Stereo, your automatic lawnmower, whatsoever. If it is no a 'cheap' Chinese product, you will notice, that in each chapter (how to do this, how to do that,...) you will find references:

"Before you start, make sure that you..."

That's all I wanted to tell you.

Last edited by Jiaz; 10.06.2022 at 18:18.
Reply With Quote
  #2284  
Old 10.06.2022, 18:24
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,047
Default

Quote:
Originally Posted by StefanM View Post
No need to shout at me.
No shouting involved.

Quote:
Originally Posted by StefanM View Post
And yes, I did not have Script Eventer installed.
Sure you can also read the article without having the EventScripter installed but it should be a logical thing that in order to be able to use it, you need to install it. As said, a sentence with that same meaning is now included in the "What is the EventScripter" article.

Quote:
Originally Posted by StefanM View Post
Please believe me, when I say, that you cannot assume that a user would read both articles. Nor can you assume that they would read both of them on the same occasion.
Yes I believe you but then that user will either not use the EventScripter at all or he will ask us.
The latter case has so far never happened

Quote:
Originally Posted by StefanM View Post
Of course there is no need to rewrite everything in every article. But a reference "Please make sure that you have Script Eventer Extension installed as described here..." does make sense.
Disagree. As said if that made sense, you'd have to cross link every instructions article from every other article.
This would also mean that, for every example of LinkCrawler Rules, we'd have to link that:
https://support.jdownloader.org/Know...kcrawler-rules
E.g.:
https://support.jdownloader.org/Know...le-deepdecrypt
https://support.jdownloader.org/Know...ple-directhttp
https://support.jdownloader.org/Know...followredirect
https://support.jdownloader.org/Know...xample-rewrite

Quote:
Originally Posted by StefanM View Post
I just wanted to share some of my experience with you, to help you, to give you at least something back. That's all.
No worries.

Quote:
Originally Posted by StefanM View Post
Just take a lot at some User's Manuals, maybe of your TV, your Stereo, your automatic lawnmower, whatsoever. If it is no a 'cheap' Chinese product, you will notice, that in each chapter (how to do this, how to do that,...) you will find references:
Yes but we are neither of both:
It's a free software and there is no time to polish those articles to a commercial level.
You're free to do so though I'm not sure if we can give you access to modifying articles yourself.

Quote:
Originally Posted by StefanM View Post
That's all I wanted to tell you.
I still disagree but as explained, you're free to do so.

I'm off into the weekend.
See you next week.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #2285  
Old 10.06.2022, 18:27
BillyCool BillyCool is offline
Super Loader
 
Join Date: Sep 2016
Location: Australia
Posts: 28
Default

Hi there,

Not sure if this is the right place to report an issue with EV, but after updating today, none of my scripts are working anymore. This is the exception trace:
Code:
net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: Java class "org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment" has no public instance field or method named "getPathSeparator". (#1)
	at net.sourceforge.htmlunit.corejs.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:71)
	at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:1047)
	at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:1094)
	at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError2(Context.java:1068)
	at net.sourceforge.htmlunit.corejs.javascript.JavaMembers.reportMemberNotFound(JavaMembers.java:823)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaClass.get(NativeJavaClass.java:100)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxWrapFactory$1.get(JSHtmlUnitPermissionRestricter.java:231)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.getProperty(ScriptableObject.java:2296)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1477)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1471)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1241)
	at script(:1)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:134)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
	at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1212)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter.evaluateTrustedString(JSHtmlUnitPermissionRestricter.java:314)
	at org.jdownloader.extensions.eventscripter.ScriptThread.evalTrusted(ScriptThread.java:325)
	at org.jdownloader.extensions.eventscripter.ScriptThread.initEnvironment(ScriptThread.java:296)
	at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:177)
	at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:160)
After troubleshooting a little bit, even a completely blank script returns this error upon doing a test run. Any ideas?

EDIT: I should add, I last updated the day before and had no issues then, so one of the more recent updates did something.

Last edited by BillyCool; 10.06.2022 at 18:29.
Reply With Quote
  #2286  
Old 10.06.2022, 18:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

@BillyCool: update is already on the way, wait 2-5 mins and hit update button
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2287  
Old 10.06.2022, 18:35
BillyCool BillyCool is offline
Super Loader
 
Join Date: Sep 2016
Location: Australia
Posts: 28
Default

@Jiaz: Thank you so much for the speedy response once again, updated just now and can confirm everything is working again!
Reply With Quote
  #2288  
Old 10.06.2022, 18:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

@BillyCool: Thanks for the feedback and sorry for the inconvenience
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2289  
Old 10.06.2022, 18:59
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 491
Default

@mgpai

Script causes error:
Code:
/*
    New Core Revision Notification
    Trigger : JDownloader started
*/

var list = "";
var file = JD_HOME + "/revisions.txt";
var revision = callAPI("jd", "getCoreRevision");

try {
    list = readFile(file);
} catch (e) {};

if (list.indexOf(revision) == -1) {
    writeFile(file, revision + "\r\n", true);
    alert("" + revision);
}
First real live test with a new core update.
On JD restart I'm getting this error message:



In test run it works fine!

What's wrong?

In case you need them, I also copied the details to a file.

Last edited by StefanM; 10.06.2022 at 20:39.
Reply With Quote
  #2290  
Old 10.06.2022, 19:02
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by StefanM View Post
What's wrong?
Was caused by a recent update. Has been fixed by @Jiaz. Update JD (if you haven't already).
Reply With Quote
  #2291  
Old 10.06.2022, 20:16
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 491
Default

Quote:
Originally Posted by mgpai View Post
Was caused by a recent update. Has been **External links are only visible to Support Staff**... by @Jiaz. Update JD (if you haven't already).
looks god now. Thank you!
Reply With Quote
  #2292  
Old 12.06.2022, 04:43
excidius excidius is offline
Vacuum Cleaner
 
Join Date: Apr 2011
Posts: 17
Default

Does someone know how to check if the download folder for a package is something in particular.. if so, it will run a script??
like
Quote:
if (link.getDownloadPath == "/incoming/folder") {
callSync("sh", "/usr/bin/scriptname");
}
Obviously wrong.. But I'm not sure what to use.
Reply With Quote
  #2293  
Old 12.06.2022, 07:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by excidius View Post
But I'm not sure what to use.
link.getDownloadPath returns the full path (folder + filename). Also, the syntax is incorrect. Should be link.getDownloadPath().

To get only the download folder use:
Code:
link.getPackage().getDownloadFolder()
Reply With Quote
  #2294  
Old 12.06.2022, 09:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

@StefanM:
you either explicit call a method, for example
Quote:
link.getPackage()
or by use of property name
Quote:
link.package
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2295  
Old 12.06.2022, 09:46
excidius excidius is offline
Vacuum Cleaner
 
Join Date: Apr 2011
Posts: 17
Default

I get a TypeError: Cannot call method "getDownloadFolder" of null (#2)
When i tried:
Code:
if (link.getPackage().getDownloadFolder() == "/incoming/folder") {
callSync("sh", "/usr/bin/command");
}
Sorry guys. I'm an idiot when it comes to this stuff.
Reply With Quote
  #2296  
Old 12.06.2022, 09:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

@excidius: what event trigger? or on *test run*?
you have to check for getPackage() != null eg
Quote:
if (link.getPackage() && link.getPackage().getDownloadFolder()...
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2297  
Old 12.06.2022, 10:18
excidius excidius is offline
Vacuum Cleaner
 
Join Date: Apr 2011
Posts: 17
Default

The event trigger was when package is completed.
Reply With Quote
  #2298  
Old 12.06.2022, 10:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

@excidius: thanks for the feedback! have you setup JDownloader to auto remove finished links/packages?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2299  
Old 12.06.2022, 10:40
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by excidius View Post
The event trigger was when package is completed.
"Package finished" trigger does not return 'link' object. You have to use:

Code:
package.getDownloadFolder()
Reply With Quote
  #2300  
Old 12.06.2022, 10:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

Quote:
Originally Posted by mgpai View Post
"Package finished" trigger does not return 'link' object. You have to use:
Code:
package.getDownloadFolder()
good catch but I still wonder why the null pointer happens on
getDownloadFolder and not on getPackage then.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2301  
Old 12.06.2022, 11:51
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
good catch but I still wonder why the null pointer happens on
getDownloadFolder and not on getPackage then.
Just checked, 'package finshed' trigger also returns a link object, which returns the the download folder correctly, if "Remove finished downloads" is not enabled. If however the "Remove finished downloads" is enabled, instead of the link object (instance) it will return only a hashmap where package is set to null.
Reply With Quote
  #2302  
Old 12.06.2022, 12:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

@mgpai: added missing link to test properties for this event.
when you have *remove finished downloads*, then the reference to its parent/Filepackage is removed and thus package is null. but the package reference should still work fine
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2303  
Old 12.06.2022, 17:41
excidius excidius is offline
Vacuum Cleaner
 
Join Date: Apr 2011
Posts: 17
Default

Ok, Yes.. I did have it set to Autoremove Downloads on complete..
It works now, after turning that off! thank you guys for the help.. :-)
Reply With Quote
  #2304  
Old 13.06.2022, 07:56
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: synchronous script with dummy script ... I will add new DownloadLinkSandbox.isAborting() method for this
Synchronous execution cannot be enabled (gets unchecked on save).
Reply With Quote
  #2305  
Old 13.06.2022, 08:06
Student im ersten Jahr Student im ersten Jahr is offline
Black Hole
 
Join Date: Nov 2020
Posts: 285
Default

@mgpai - Can you please provide a script to save direct links to a text file?

https://board.jdownloader.org/showpo...postcount=3250
Reply With Quote
  #2306  
Old 13.06.2022, 08:57
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Student im ersten Jahr View Post
@mgpai - Can you please provide a script to save direct links to a text file?
Code:
/*
    Save direct links to text
    Trigger: A Download stopped
*/

if (link.downloadHost == "vk.com") {
    var directLink = link.getProperty("picturedirectlink") || link.getProperty("directurls_fallback");

    try {
        directLink && writeFile(link.downloadPath + ".txt", directLink, false);
    } catch (e) {};
}

@Jiaz: One example where mere mortals who wish to offer support/help need access to obfuscated content.
Reply With Quote
  #2307  
Old 13.06.2022, 11:23
Student im ersten Jahr Student im ersten Jahr is offline
Black Hole
 
Join Date: Nov 2020
Posts: 285
Default

1. I have installed "Event Scripter"
2. I have added this script.
3. Enabled.
But is there anything more that should be done?
By default I have "Trigger": None
And where are the links saved on the disk?

Code:
Spoiler:
net.sourceforge.htmlunit.corejs.javascript.EcmaError: ReferenceError: "link" is not defined. (#6) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3613) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3683) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.name(ScriptRuntime.java:1690) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1622) at script(:6) at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:134) at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057) at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1212) at org.jdownloader.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:320) at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:180) at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:160)
Reply With Quote
  #2308  
Old 13.06.2022, 11:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Student im ersten Jahr View Post
By default I have "Trigger": None
Set trigger as specified in the script:
Code:
Trigger: A Download stopped

Quote:
Originally Posted by Student im ersten Jahr View Post
And where are the links saved on the disk?
Same download location, Same name. Extension 'txt'.
Reply With Quote
  #2309  
Old 13.06.2022, 11:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

Quote:
Originally Posted by Student im ersten Jahr View Post
By default I have "Trigger": None
see the script info
Quote:
Originally Posted by mgpai View Post
Code:
/*
    Trigger: A Download stopped
*/
Quote:
Originally Posted by Student im ersten Jahr View Post
By default I have "Trigger": None
And where are the links saved on the disk?
it's stored as filePath.txt
Quote:
link.downloadPath + ".txt"
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2310  
Old 13.06.2022, 18:22
Student im ersten Jahr Student im ersten Jahr is offline
Black Hole
 
Join Date: Nov 2020
Posts: 285
Default

mgpai & Jiaz Now it's Ok! Thanks a lot!
Reply With Quote
  #2311  
Old 15.06.2022, 12:19
m_speed m_speed is offline
Modem User
 
Join Date: Jun 2022
Posts: 2
Default File extraction in order

Requesting a script that waits until file extraction is done before starting with the next download. Then auto renames the extracted file to the rar's name.
Reply With Quote
  #2312  
Old 15.06.2022, 12:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

Quote:
Originally Posted by m_speed View Post
Requesting a script that waits until file extraction is done before starting with the next download. Then auto renames the extracted file to the rar's name.
@mgpai: you can active wait in while(isextracting)sleep(1) or something like that
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2313  
Old 15.06.2022, 12:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: you can active wait in while(isextracting)sleep(1) or something like that
Is there an 'isExtracting' call/method? Have created a script which checks extraction queue. Guess that should do the job. But, THIS bug needs to be fixed first for the script to work.

Quote:
Originally Posted by m_speed View Post
Requesting a script that waits until file extraction is done before starting with the next download.
Code:
/*
    Wait till extraction is finished
    Trigger : A Download Started
    IMPORTANT: Enable 'Synhronous Execution' checkbox in the top panel
*/

while(isExtracting()){
    sleep(1000);
}

function isExtracting() {
    return callAPI("extraction", "getQueue").length > 0;
}

A bug currently prevents the 'sync execution' setting to be saved. Please wait for the bug fix before starting to use the script.

Quote:
Originally Posted by m_speed View Post
Then auto renames the extracted file to the rar's name.
You can use packgizer for this. It has an option to rename files after extraction.
Reply With Quote
  #2314  
Old 15.06.2022, 13:09
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

Quote:
Originally Posted by mgpai View Post
You can use packgizer for this. It has an option to rename files after extraction.
user wants the archive filename to be used, so I guess script would be much easier
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2315  
Old 15.06.2022, 13:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

Quote:
Originally Posted by mgpai View Post
A bug currently prevents the 'sync execution' setting to be saved. Please wait for the bug fix before starting to use the script.
Will be fixed with next core update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2316  
Old 15.06.2022, 13:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
user wants the archive filename to be used, so I guess script would be much easier
I think there are some scripts in this thread which could that. But, end-users may find it easier to customize it in packagizer than tweak the script. I have recommended it in the past to several users, and I guess should still work fine.

For example, packagename is usually derived from archive name. So can use:
Code:
Then do > rename to : <jd:packagename>.<jd:orgfiletype>

(Tested just now. Working fine)

Guess a packagizer property for archive name will be useful in cases like this.

<jd:archivename> ?
Reply With Quote
  #2317  
Old 15.06.2022, 14:09
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,456
Default

Quote:
Originally Posted by mgpai View Post
guess a packagizer property for archive name will be useful in cases like this.
<jd:archivename> ?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2318  
Old 15.06.2022, 14:43
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
user wants the archive filename to be used, so I guess script would be much easier
Code:
/*
    Rename extracted files
    Trigge: Archvie extraction finished
*/

var name = archive.name;

archive.extractedFilePaths.forEach(function(filePath) {
    filePath.renameName(name + "." + filePath.extension);
})
Reply With Quote
  #2319  
Old 15.06.2022, 16:45
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by StefanM View Post
(Random) delay while downloading
Quote:
Originally Posted by Jiaz View Post
@mgpai: synchronous script
Code:
/*
    Random delay before download
    Trigger : A Download Started
    IMPORTANT : Enable "Synchronous execution" checkbox in the top panel
*/

var seconds = Math.floor(Math.random() * 5) + 1 // 1 to 5 seconds

while (seconds && !link.aborting) {
    sleep(seconds * 1000);
    seconds--;
}
Reply With Quote
  #2320  
Old 16.06.2022, 11:09
theskyishigh theskyishigh is offline
Baby Loader
 
Join Date: Oct 2015
Posts: 7
Default

Script to Clean Up Download Tab

Hi. I need a script to clean up my Download tab. Basically, remove all finished packages/files that have been deleted/moved. Such a script would need to do the following.

1. Go through all the packages that have finished downloading.
2. Check if the downloaded files exist on the disk.
3. If the downloaded files do not exist on the disk, then remove them from the download tab.
4. If the package folder does not exist on the disk, then remove it from the download tab.

Is there already such a script? @Jiaz suggested that @mgpai might be able to help?

Thanks in advance for any help anyone may provide.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 17:40.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.