#721
|
|||
|
|||
Here is a new script, but if you need help to troubleshoot/fix yours, contact me in JD Chat.
Code:
// Move archive files after extraction // Trigger: Archive Extraction Finished var links = archive.getDownloadLinks() || []; var destinationFolder = "C:/sherbee/check"; links.forEach(function(link) { var filePath = getPath(link.getDownloadPath()); var i = 0; while (getPath(destinationFolder + "/" + filePath.getName()).exists()) { i++; newPath = getPath(link.getDownloadPath().toString().replace(/(.+)(\..+)/, "$1" + i + "$2")); getPath(filePath).renameTo(newPath); filePath = newPath; } filePath.moveTo(destinationFolder); }); |
#722
|
|||
|
|||
True, but I am not comfortable helping anyone scam the hosters. If (I feel) the requirement is legitimate (as in this case), I will try to help in any way I can.
|
#723
|
|||
|
|||
Quote:
Code:
webchat.freenode.net/?channels=jdownloader |
#724
|
|||
|
|||
Quote:
2 Questions I have:
Only thing I must change is Code:
replace(/(.+)(\..+)/, "$1" + i + "$2")); Code:
replace(/(.+)(\..+)/, "$1 (" + i + ")$2")); |
#725
|
|||
|
|||
|
#726
|
||||
|
||||
1.) depends on your OS, Unix(/) vs Windows (\)
2.1) without dot 2.2) I guess in the past it was different instance or just wanted to make sure that string return type
__________________
JD-Dev & Server-Admin |
#727
|
|||
|
|||
Hello,
the code example Save youtube links and basic information to a html page contains the following invalid line: Code:
if (youtubeMedia) { var output = []; var variant = JSON.parse("YT_VARIANT".prop()); var variantData = JSON.parse(variant.data); var youtube = "<a href=\"External links are only visible to Support Staff; Many thanks and greetings JDFan |
#728
|
|||
|
|||
Quote:
Code:
var youtube = "<a href=\"External links are only visible to Support Staff; Script: Code:
gist.github.com/mgpai/defe23044e32d7cec7756053997295e1/download |
#729
|
|||
|
|||
Corresponds EventScripter YT_CHANNEL_TITLE to Plugins Filename & Packagename CHANNEL?
Hello,
the result of the following script is always null: Code:
if (name == "YT Test") { sYT_Channel_Title = downloadLinks[0].getProperty("YT_CHANNEL_TITLE") ; alert("YT_Channel_Title: " + sYT_Channel_Title) ; } My filename contains an CHANNEL, so the package should contain one. Many thanks and greetings JDFan |
#730
|
|||
|
|||
Code:
var channelName = myDownloadLink.getProperty("YT_CHANNEL"); |
#731
|
||||
|
||||
Quote:
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. |
#732
|
|||
|
|||
Wait / Sleep
Hi.
The trigger is "A download started". With the following code, downloads are "freezed" : Code:
function Stream() { if (isDownloadControllerRunning()) { alert("OK !"); sleep(30000); Stream(); } } Stream(); (This is for testing purpose, my idea is to replace "alert("OK !");" with a function I want to check every 30 seconds while the "Download Controller" is running). Is there a way to achieve that (pausing only the script) ? Thanks ! Last edited by bobolecoco; 30.05.2019 at 15:56. |
#733
|
|||
|
|||
Disable the "Synchronous execution of script" checkbox.
If you can provide information on what you want to achieve with the function/script, we can look into it. |
#734
|
|||
|
|||
Thanks
Thanks, it worked. So if 2 downloads start, the script will run twice ? Should I use "Download controller started" trigger instead if I want only one instance to run ?
I already have a working script, it runs every 30 seconds (interval 30000). But it's relevant only when a download is running. It allows me to put a speed limit when a twitch channel is streaming, so bandwidth stay available to watch the stream. Here it is : Code:
var myBrowser = getBrowser(); myBrowser.setHeader("Accept", "application/vnd.twitchtv.v3+json"); myBrowser.setHeader("Client-ID", "HereIsMyPrivateClientId"); myBrowser.getPage("**External links are only visible to Support Staff**); if (!/"stream":null/.test(myBrowser.getHTML())) { setSpeedlimit(1.5 * 1024 * 1024); } else { setSpeedlimit(0); } Am I clear enough (English is not my natural language) ? A problem I have is when twitch's server is not reachable for a brief moment : it triggers an error, and the script disables itself. So running it only when downloading reduce the probability to trigger that error. An other solution would be to extent time before a timeout error is fired, but I didn't find any option like this with getBrowser(). A reliable way to do it would be to create an external script that check if there is a streaming, that JD runs from event scripter. But my idea was to NOT use an external script. |
#735
|
|||
|
|||
Yes
Quote:
Quote:
Sample Code (Totally untested) : Code:
// Toggle Speed Limit // Trigger: Download Controller Started // IMPORTANT: Disable 'Synchronous Execution' while (isDownloadControllerRunning()) { if (streaming()) { setSpeedlimit(1.5 * 1024 * 1024); } else { setSpeedlimit(0); } sleep(30000); } //Functions function streaming() { try { var myBrowser = getBrowser(); myBrowser.setHeader("Accept", "application/vnd.twitchtv.v3+json"); myBrowser.setHeader("Client-ID", "HereIsMyPrivateClientId"); myBrowser.getPage("hxxps://api.twitch.tv/kraken/streams/TheNameOfTheTwitchChannel"); return /"stream":null/.test(myBrowser.getHTML()); } catch (e) { //On error assume it is atreaming? return true; } } |
#736
|
|||
|
|||
Thanks again
It seems to work. I'll see if errors appear in the future.
Thanks ! I'll keep you posted if anything new happens ! |
#737
|
|||
|
|||
Avoid disabling erroneous scripts
Hello,
erroneous scripts are automatically disabled in the Settings -> Event Scripter after the first run. That makes sense, but not during testing. Any way to switch that behaviour off? Many thanks and greetings JDFan |
#738
|
||||
|
||||
@JDFan: Script won't get disabed when testing script. you want a way to disable *auto disable* in script?
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 03.06.2019 at 09:22. |
#739
|
|||
|
|||
Mgpai,
I would like create a script to download some steaming with a scheduler that consider days, hours and minutes. I am not a programmer...can tell me how I can work out it? |
#740
|
|||
|
|||
I would prefer a global switch in Advanced Settings. I assume that's easier to implement compared to a change in the script engine.
|
#741
|
||||
|
||||
script command is much easier than global switch also script command has the advantage that yuo can enable/disable it within the same script and not have impact on all other scripts as well
__________________
JD-Dev & Server-Admin |
#742
|
|||
|
|||
YouTube plugin: What does YT_DESCRIPTION contain?
I'm wondering because I get always null!
|
#743
|
|||
|
|||
Then a script command please! Many thanks in advance.
|
#744
|
||||
|
||||
@JDFan: it contains the description/text but only temporarily and currently not available via normal getProperty because those details are fetched and cached during session, not stored.
__________________
JD-Dev & Server-Admin |
#745
|
||||
|
||||
after next core update there are
setNotifyOnException(true/false), show(yes,no) dialog to inform about exception setDisableOnException(true/false), disable(yes,no) script on exceptions
__________________
JD-Dev & Server-Admin |
#746
|
|||
|
|||
alert box is flickering, complex problem
Complex problem, really. Script triggered by Script Downloadlist Contextmenu Button Pressed (name Test). YouTube video is downloaded. Flickers only with that link (others too). BUT when you change only some letters of 0Mp2kwE8xY0 no flickering (e. g. M -> 1)! Can someone reproduce that crazy behaviour?
Code:
if ( name == "Test" ) { // 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\ alert( "Line1: **External links are only visible to Support Staff**) ; } |
#747
|
|||
|
|||
alert box wishes
1. Optional (checkbox) non-proportional font like Courier New. Better readable debug outputs.
2. Properties for x, y, w(idth) and h(eight). 3. Copy to Clipboard button. Maybe Paste too. |
#748
|
|||
|
|||
Clipboard access via script
Reading from and writing to the clipboard should be possible. Maybe with special security flag via Advanced Settings.
|
#749
|
|||
|
|||
Input dialog
Would simplify automation (passing parameters from other apps, e. g. AutoHotkey and speech recognition). Maybe with special security flag via Advanced Settings.
|
#750
|
|||
|
|||
Get hostname
Maybe via the Environment Object? getHostname()?? Different PCs/notebooks, different folder structures. Want to set pathes depending on the PC/notebook in use.
Edit: There seems to be an environment variable COMPUTERNAME. Code:
sComputerName = getEnv( "COMPUTERNAME" ) ; alert( sComputerName ) ; Last edited by JDFan; 03.06.2019 at 21:20. |
#751
|
|||
|
|||
Global variables
Should be accessible by all scripts. For a limited number of global script variables environment variables could be used of course, like JD_VarName.
|
#752
|
|||
|
|||
Event Scripter export/import
The possibility to export all marked scripts would be great. Should be an xml file so it could be created/modified with other tools. And of course the corresponding import functionallity.
Maybe with support by the event scripter itself? Methods like listScripts(), exportScripts(), importScripts(), enableScripts(), disableScripts(). Parameter an arrray of scripts. Propeties enabled, name, trigger plus all the GUI settings. |
#753
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#754
|
||||
|
||||
What *global variables* do you mean? You already can use set/getProperty(key,boolean) method with local(script,false)) or global(shared,true) and share information accross different scripts with help of global properties
__________________
JD-Dev & Server-Admin |
#755
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#756
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#757
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#758
|
|||
|
|||
Event Scripter export/import
@mgpai:
Can you be so kind and support me with some basic hints, e. g. concerning callapi and where I can find the corresponding methods: |
#759
|
|||
|
|||
INI file support and JSON
I really like INI files. And JSON, too. Scripter support?
|
#760
|
||||
|
||||
@JDFan: see https://my.jdownloader.org/developers/ for list of api methods and their parameters
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|