JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2961  
Old 18.06.2024, 09:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,180
Default

@hulleyrob: sometimes solution is easier than thought Thanks for sharing your solution!
I will still work on better/easier browser usage. In case you need further help/got questions, just ask
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2962  
Old 18.06.2024, 10:46
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 588
Default

@mpgai
New Script Request:

A script which converts ssssss.ms (sec. and msec.) to hh:mm:ss.xxx

Great thanks to Jiaz and especially pspzockerscene for implementing below properties in the PlugIns for keep2share and fileboom:
  • video_duration
  • video_width
  • video_height
  • video_format
Now, you can have these properties being shown in 'comments' by creating a Packagizer Rule.

Important note: In order to get this working, in the PlugIn settings - e.g. for k2s (keep2share) - you need to set single linkcheck as File linkcheck mode.

In Packagizer Rules, for Download-URLs which contain e.g k2s.cc
set Comment as e.g. as <jd:prop:video_width>,<jd:prop:video_duration>

For each new link added to LingGrabber, those properties will be shown in comments.

The duration, however, is shown as raw value.
For example:
4259.042 which is 4259 sec. and 42 msec.
What I would like to see is format hh:mm:ss.xxx
In this example 01:10:59.042

And for this conversion I would like to ask for a script.

Thank you very much for any efforts taken!
Reply With Quote
  #2963  
Old 20.06.2024, 10:42
hulleyrob hulleyrob is offline
JD Alpha
 
Join Date: Dec 2022
Posts: 22
Default

Quote:
Originally Posted by Jiaz View Post
@hulleyrob: sometimes solution is easier than thought Thanks for sharing your solution!
I will still work on better/easier browser usage. In case you need further help/got questions, just ask
funny you should say that, I have intermittent problem when running the event script a massive popup box appears occasionally with an IOException 424 failed dependency as the most obvious part of the error.

Is it worth uploading the logs for you to take a look?
20.06.24 06.16.53 <--> 20.06.24 08.43.39 jdlog://3653411370661/

Also once it has failed it disables the script. just enabling it again makes it work fine for another x times.
Reply With Quote
  #2964  
Old 20.06.2024, 12:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,180
Default

@hulleyrob: looks like some timeout issues with apprise, see
github.com/caronc/apprise-api/issues/29
github.com/caronc/apprise-api/issues/16
you should be able to try/catch the error to avoid the dialog/auto disable of the script
alternative you can make use of the following commands
Quote:
setAdvancedAlert(myBoolean);/*enable/disable alert with textbox and copy&paste*/
setDisableOnException(myBoolean);/*enable/disable script on exceptions*/
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2965  
Old 20.06.2024, 15:42
hulleyrob hulleyrob is offline
JD Alpha
 
Join Date: Dec 2022
Posts: 22
Default

Thank you will give it a go later when I get home.
Reply With Quote
  #2966  
Old 20.06.2024, 17:19
hulleyrob hulleyrob is offline
JD Alpha
 
Join Date: Dec 2022
Posts: 22
Default

try {
postPage('**External links are only visible to Support Staff**,
"urls=synology://192.168.0.4:5000/TOKEN&body=" + package.getName() +
" finished.");
}
catch (e) {
if (!(e instanceof Error)) {
e = new Error(e);
}
console.error(e.message);
}

A quick google of a JavaScript try catch and this appears to be working.

Can you suggest any improvements?
Reply With Quote
  #2967  
Old 21.06.2024, 00:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,180
Default

@hulleyrob: maybe URL encode package name to avoid issues if special/forbidden chars are part of it&final URL.
also maybe enqueue stuff that failed and retry sending them a few seconds later?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2968  
Old 21.06.2024, 17:31
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,572
Default

Quote:
Originally Posted by StefanM View Post
What I would like to see is format hh:mm:ss.xxx
If you find a suitable JS snippet on github[gist] or stackoverflow which can do it, I can help you add it to eventscripter.
Reply With Quote
  #2969  
Old 21.06.2024, 17:47
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 588
Default

Quote:
Originally Posted by mgpai View Post
If you find a suitable JS snippet on github[gist] or stackoverflow which can do it, I can help you add it to eventscripter.
Thanks for taking a look at my request!

What I have is an Excel formula which can do the job. But I guess that cannot be used here.

But in the meantime:
Would it at least be possible to replace the "." (point) with a "," (comma).

Example:
12345.678 should be replaced with 12345,678
Could you create a script, which can do this "replacement" job?

That would also help me.
Thanks in advance for any efforts taken!
Reply With Quote
  #2970  
Old 21.06.2024, 18:06
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,572
Default

Quote:
Originally Posted by StefanM View Post
... replace the "." (point) with a "," (comma).
Code:
/*
    generate "video_duration_comma" 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) {
        link.setProperty("video_duration_comma", duration.toString().replace(".",","));
    }
}
Reply With Quote
  #2971  
Old 21.06.2024, 18:54
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 588
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    generate "video_duration_comma" 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) {
        link.setProperty("video_duration_comma", duration.toString().replace(".",","));
    }
}
Not working for me.
Probably my mistake?

I selected "packagizer hook"
I set the checkbox "synchronous execution of script"

But still output in comment is something like this for duration:
4149.412 as it is without the script.
Any ideas what I could have done wrong?
Reply With Quote
  #2972  
Old 21.06.2024, 19:08
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,572
Default

Quote:
Originally Posted by StefanM View Post
Not working for me.
Which placeholder have you used in packagier rule?
Reply With Quote
  #2973  
Old 21.06.2024, 19:47
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 588
Default

Quote:
Originally Posted by mgpai View Post
Which placeholder have you used in packagier rule?
Code:
<jd:prop:video_duration>		<jd:prop:video_width>	<jd:prop:video_height>	<jd:prop:video_format>
all separated by tabs.

But now I see my mistake:
should haved used <jd:prop:video_duration_comma>

Now it's working!
Thank you very much!

Last edited by StefanM; 21.06.2024 at 19:50.
Reply With Quote
  #2974  
Old 21.06.2024, 19:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,572
Default

Quote:
Originally Posted by StefanM View Post
...all separated by tabs.
Quote:
generate "video_duration_comma" property
Will leave the original unchanged and add a new property.
Reply With Quote
  #2975  
Old 21.06.2024, 19:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,572
Default

Quote:
Originally Posted by StefanM View Post
Thank you very much!
You're welcome.
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 04:18.
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.