JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 19.01.2024, 16:44
jd_enjoyer jd_enjoyer is offline
Modem User
 
Join Date: Jan 2024
Posts: 2
Default Event Script on headless debian

Hello,

few weeks ago i switched to a new system (from windows to debian) and for some reason my event script is not working and i think it's not even being executed. I've played around quite a bit, the only thing i noticed is if i use a different trigger (on package finished) my bash script is being executed. If i use ON_ARCHIVE_EXTRACED i don't get any output / error. The scripts below are now for test purposes that should execute filebot.. I've tried others as well for debugging but as stated above, no output.


jdlog://2230411370661


-- REMOTE SYSTEM -------------------------------------------
OS: Linux (LINUX 64Bit) (amd64 64Bit)
JAVA: 17.0.9+9-Debian-1deb12u1 (64Bit) (headless)
Debian
OpenJDK 64-Bit Server VM
JAVA HEAP: 40.86 MB / 142.61 MB / 8.35 GB
STARTUP TIME: 00h 01m 58s (startup time: 18.01.24 21:01)

[STORAGE INFORMATION]
/: 76776996864 / 118111600640
/mnt/disk1: 7236143271936 / 17927505408000
/mnt/disk2: 1241304416256 / 10000829247488
/mnt/disk3: 186727550976 / 6001039241216


shell script

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

# Configuration
CONFIG_OUTPUT="/mnt/disk2/_download/extracted/"

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict skip -non-strict --log-file /root/amc.log --def skipExtract=y unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"



org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json

Code:
[{"eventTrigger":"ON_ARCHIVE_EXTRACTED","eventTriggerSettings":{"isSynchronous":false},"id":1705607093820,"name":"Execute FileBot (PackageFinished)","script":"var script = JD_HOME + '/jdownloader-postprocess.sh'\n\nvar package = archive.getDownloadLinks() ? archive.getDownloadLinks()[0].getPackage() : null\nvar links = package ? package.getDownloadLinks() : []\n\nfunction isReallyFinished() {\n\tfor (var i = 0; i < links.length; i++) {\n\t\tif (links[i].getArchive() != null && links[i].getExtractionStatus() != \"SUCCESSFUL\" || !package.isFinished()) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nif (package && isReallyFinished()) {\n\tvar command = [script, package.getDownloadFolder(), package.getName(), package.getComment() ? package.getComment() : 'N/A', 'ARCHIVE_EXTRACTED']\n\tlog(command)\n\tlog(callSync(command))\n}","enabled":true}]
Any help is appreciated!


EDIT: Running the script directly works just fine.
Reply With Quote
  #2  
Old 22.01.2024, 19:20
jd_enjoyer jd_enjoyer is offline
Modem User
 
Join Date: Jan 2024
Posts: 2
Default

After unticking "Extraction: Delete Archive Downloadlinks After Extraction
Delete archive DownloadLinks after successful extraction?" the script is being executed.

Why would the script not run with this ticked? Was running fine under 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 19:53.
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.