JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2881  
Old 14.04.2024, 21:57
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,532
Default

@wizhack: Thanks for sharing your findings and feedback. Would have been my next question to check if bash is available
check ownership/permission for the nfs share or mount that the docker user will be mapped to correct nfs user
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2882  
Old 14.04.2024, 23:22
wizhack wizhack is offline
Baby Loader
 
Join Date: Apr 2024
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
@wizhack: Thanks for sharing your findings and feedback. Would have been my next question to check if bash is available
check ownership/permission for the nfs share or mount that the docker user will be mapped to correct nfs user
Finally it's not a permission issues in the nfs share, its the way that mv command act.
so the mv command doesn't act like a normal bash command (for the folder part) so i have to find a way to move folder, the easy way would be:
mkdir in /mnt/4K with filename > cp file in the "newfolder" > rm -R old folder, dirty way in my opinions... if you have suggestions i'm open !
Reply With Quote
  #2883  
Old 15.04.2024, 13:37
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,532
Default

@wizhack: maybe check if mv might be part of internal bash but also be available as stand alone mv executable with different feature set? most likely it's something like that
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2884  
Old 15.04.2024, 17:05
wizhack wizhack is offline
Baby Loader
 
Join Date: Apr 2024
Posts: 6
Default

This is it !
so the built-in mv comand in alpine-linux is a part of busybox so it's explain why it was acting weird because i didn't know that i was looking for using a mv from coreutils. so here i did:

Install the coreutils package in the container (alpine linux)
Code:
apk add coreutils utmps
and check the version of the new mv
Code:
mv --version
it should tell you something like
Code:
mv (GNU coreutils) 9.1
and now i can act like i did before, thanks for putting me on the way @Jiaz
Reply With Quote
  #2885  
Old 15.04.2024, 17:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,532
Default

@wizhack: thanks for feedback and confirmation
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2886  
Old 15.04.2024, 18:10
wizhack wizhack is offline
Baby Loader
 
Join Date: Apr 2024
Posts: 6
Default

Here is my script, i used 2 trigger 1 for package finished and 1 for extraction finished

Move folder based on name of file with a script shell

Don't forget to check the box for preventing running the script in parallel

Code:
var movefolder = '/config/scripts/movefolder.sh';
callSync(movefolder);
far from perfect but it does the job, maybe using callAsync() but i have some error when i try callAsync(movefolder);

And the movefolder.sh

Code:
#!/bin/bash

# Check subfolder from /output
find /output -mindepth 1 -maxdepth 1 -type d | while IFS= read -r dir; do
    # check for *.part files
    if find "$dir" -type f -name "*.part" -print -quit | grep -q .; then
        echo "Le dossier $dir contient des fichiers avec l'extension .part. Il est ignoré."
        continue
    fi

    # Extract namefolder
    dirname=$(basename "$dir")

    # if folder has *1080*, *2160*, *4k*, ou *s??e??*
    if [[ $dirname == *1080* || $dirname == *2160* || $dirname == *4k* || $dirname == *s??e??* || $dirname == *s??* ]]; then
        # Si le dossier contient un fichier .rar, afficher un message d'erreur et passer au suivant
        if find "$dir" -type f -name "*.rar" -print -quit | grep -q .; then
            echo "Un fichier .rar a été détecté dans le dossier $dir. Le dossier est ignoré."
            continue
        fi

        # Déplacer le dossier vers le répertoire de destination approprié
        if [[ $dirname == *s??e??* ]]; then
            mv "$dir" "/mnt/FR-TV/"
        elif [[ $dirname == *1080* ]]; then
            mv "$dir" "/mnt/FR-HD/"
        elif [[ $dirname == *2160* || $dirname == *4k* ]]; then
            mv "$dir" "/mnt/FR-4K/"
        fi
    fi
done

Last edited by wizhack; 15.04.2024 at 19:06.
Reply With Quote
  #2887  
Old 15.04.2024, 21:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,532
Default

@wizhack: Thanks for sharing your whole solution
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2888  
Old 17.04.2024, 08:24
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

Would it be possible to make a script so that JD plays a (selectable) acoustic signal after, for example, 4 minutes without an internet connection (after a reconnect)? So if the reconnect hadn't worked? The signal could then be repeated, for example, every 5 minutes (as long as there is no internet connection). Can be stopped when an internet connection is available again.
__________________
Aktuelles Windows

Last edited by Dockel; 17.04.2024 at 08:31.
Reply With Quote
  #2889  
Old 17.04.2024, 09:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,532
Default

@Dockel: Yes, that should be possible, better ask mgpai, our scripter magician, for help or do some "trial and error" by yourself
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2890  
Old 17.04.2024, 10:08
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

Oops, sorry, I thought if it was about scripts, one asked in this thread here, in which - I thought - magpai is also present. So where do I have to ask?

I guess, by doing some "trial and error" by myself I just would destroy JD completely.
__________________
Aktuelles Windows
Reply With Quote
  #2891  
Old 17.04.2024, 12:01
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,103
Default

Quote:
Originally Posted by Dockel View Post
So where do I have to ask?
You are already right in this thread, you just mis-understood Jiaz.
__________________
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
  #2892  
Old 17.04.2024, 12:09
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

What exactaly did I misunderstand?
__________________
Aktuelles Windows
Reply With Quote
  #2893  
Old 17.04.2024, 12:19
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,103
Default

Quote:
Originally Posted by Jiaz View Post
better ask mgpai, our scripter magician, for help or do some "trial and error" by yourself
By just posting in this thread, mgpai will most likely already read your questions - no need to ask him separately.
__________________
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
  #2894  
Old 17.04.2024, 12:32
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

Quote:
By just posting in this thread, mgpai will most likely already read your questions - no need to ask him separately.
Yes, okey, I thought that too.

OK, now I still don't know what exactly I misunderstood, but everything seems to be as it should be. So I just will watit. Thank you!
__________________
Aktuelles Windows
Reply With Quote
  #2895  
Old 17.04.2024, 12:57
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,549
Default

Quote:
Originally Posted by Dockel View Post
Would it be possible to make a script so that JD plays a (selectable) acoustic signal after, for example, 4 minutes without an internet connection (after a reconnect)? So if the reconnect hadn't worked? The signal could then be repeated, for example, every 5 minutes (as long as there is no internet connection). Can be stopped when an internet connection is available again.
Code:
/*
    connection notification
    trigger : interval (300000)
    enable 'synchronous execution of script' checkbox
*/

var time = Date.now() + 4 * 60 * 1000;
var connected = false;

while (!connected && Date.now() < time) {
    try {
        getPage("http://jdownloader.org");
        connected = true;
    } catch (e) {};

    sleep(1000);
}

if (!connected) {
    playWavAudio(JD_HOME + "/themes/standard/org/jdownloader/sounds/captcha.wav");
}
Reply With Quote
  #2896  
Old 17.04.2024, 13:20
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

That was incredibly fast, thank you very much!

Now I have it like this:


Could I change the interval of the no Internet connection signal being repeated as long as there is no connection? Or turn off the repetition (if need be)?
__________________
Aktuelles Windows
Reply With Quote
  #2897  
Old 17.04.2024, 13:42
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,549
Default

Quote:
Originally Posted by Dockel View Post
Could I change the interval of the no Internet connection signal being repeated as long as there is no connection? Or turn off the repetition (if need be)?
Interval value in the top field controls how often the script is exexuted. The variable 'time' controls the wait time before playing a aound. In your example, the script runs every 4 mins (240000) and on each run, plays a sound if connection is continuously not avaialable for 4 mins (4 * 60 * 1000).

If you do not want repeatition, used the following script:
Code:
/*
    connection notification
    trigger : after a reconnect
*/

if(result == "FAILED"){
    sleep(4 * 60 * 1000);
    playWavAudio(JD_HOME + "/themes/standard/org/jdownloader/sounds/captcha.wav");
}
Reply With Quote
  #2898  
Old 17.04.2024, 14:29
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

Quote:
Interval value in the top field controls how often the script is exexuted. The variable 'time' controls the wait time before playing a aound. In your example, the script runs every 4 mins (240000) and on each run, plays a sound if connection is continuously not avaialable for 4 mins (4 * 60 * 1000).
So the script runs ALWAYS. As long as JD is running. And if it detects that there is no connection it waits for 4 minutes until it plays a sound and so on?

So the length of the interval the signal is repeated can be changed by changing the value 4 (var time = Date.now() + 4 * 60 * 1000;) to another one, e.g. to 60 for 60 min.

Quote:
If you do not want repeatition, used the following script:
OK, that is great, thank you very much! So I just can turn the other script off and this one on, if I do not want a repetitional sound.
__________________
Aktuelles Windows

Last edited by Dockel; 17.04.2024 at 14:37.
Reply With Quote
  #2899  
Old 17.04.2024, 16:09
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,549
Default

Quote:
Originally Posted by Dockel View Post
So the script runs ALWAYS. As long as JD is running. And if it detects that there is no connection it waits for 4 minutes until it plays a sound and so on?

So the length of the interval the signal is repeated can be changed by changing the value 4 (var time = Date.now() + 4 * 60 * 1000;) to another one, e.g. to 60 for 60 min.
Total interval = 1st interval + 2nd Interval
In your example it will be 240000 + 60 * 60 * 1000 = 64 minutes.

I would recommend using a script with a single interval. It will check for connection every x milliseconds, and play a sound only if connection is not present.

Code:
/*
    connection notification
    trigger : interval (300000)
*/

try {
    getPage("http://jdownloader.org");
} catch (e) {
    playWavAudio(JD_HOME + "/themes/standard/org/jdownloader/sounds/captcha.wav");
}
Reply With Quote
  #2900  
Old 17.04.2024, 16:26
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

OK, thank you very much for the new script. Sorry, I do not understand anything, but I guess, it will play a sound once (not repeatedly), if there is not connection for 5 minutes?

Hope, that is correct:


Many thanks!
__________________
Aktuelles Windows
Reply With Quote
  #2901  
Old 17.04.2024, 16:31
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,549
Default

Quote:
Originally Posted by Dockel View Post
OK, thank you very much for the new script. Sorry, I do not understand anything, but I guess, it will play a sound once (not repeatedly), if there is not connection for 5 minutes?
Try all of them and find out.
Reply With Quote
  #2902  
Old 17.04.2024, 20:03
Dockel Dockel is online now
JD Legend
 
Join Date: Feb 2020
Posts: 676
Default

OK, so each script a surprise egg (may be a good idea for another thread: making surprise egg-scripts, nobody knows what will happen).

Thank you very much again, very happy about the scripts!
__________________
Aktuelles Windows
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 08:35.
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.