#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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 16: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, 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
|
|||
|
|||
![]()
It seems to work. I'll see if errors appear in the future.
Thanks ! I'll keep you posted if anything new happens ! |
#737
|
|||
|
|||
![]()
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 10: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.
|
![]() |
Thread Tools | |
Display Modes | |
|
|