JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2921  
Old 26.04.2024, 13:19
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by StefanM View Post
... script which marks all occurrences of duplicates.
Code:
/*
    disable dupes
    trigger : toolbar button pressed
*/

if (name == "disable dupes") {
    var original = [];

    getAllCrawledLinks().forEach(function(link) {
        var url = link.contentURL;
        
        if(url){
            if(original.indexOf(url) == -1){
                original.push(url);
                //link.comment = "original";
            } else {
                link.enabled = false;
                //link.comment = "dupe"
            }
        }
    })
}

Script also has an option to set comment which is disabled by default. If enabled, the comment on first link will be set as 'orginal' and subsequent links will be set to "dupes". This will be useful for creating view filters.
Reply With Quote
  #2922  
Old 26.04.2024, 17:54
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 705
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    disable dupes
    trigger : toolbar button pressed
*/

if (name == "disable dupes") {
    var original = [];
...
Script also has an option to set comment which is disabled by default. If enabled, the comment on first link will be set as 'orginal' and subsequent links will be set to "dupes". This will be useful for creating view filters.
First of all: Thank you very much.

EDIT
Problem: When I enable the Scripter-button in the toolbar, another script gets started. That way I can only enable or disable all my scripts.

Finally got it working, disabling dupes that is.
But I had to change the trigger to LinkGrabber Context Menu Button pressed.

With 25,000 links in LinkGrabber, it takes about 12 seconds until the dupes are disabled. But that's ok.


But I still don't know how to enable the comments, 'original' and 'dupes'.
Can you please explain how I can enable comments?




Thanks again and best regards,
Stefan

Last edited by StefanM; 26.04.2024 at 20:38.
Reply With Quote
  #2923  
Old 27.04.2024, 09:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by StefanM View Post
A toolbar button is more suitable since the objects used in the script are global. The name in the toolbar button should match the name used in the script. Change the toolbar button name from the default name to "disable dupes" (without quotes).

Since the script will overwite any custom comments set by the user, it is disabled by default (commented out). Uncomment the relevant code. For e.g, change:
Code:
//link.comment = "original";
to
Code:
link.comment = "original";
Reply With Quote
  #2924  
Old 27.04.2024, 11:04
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 705
Default

Quote:
Originally Posted by mgpai View Post
A toolbar button is more suitable since the objects used in the script are global. The name in the toolbar button should match the name used in the script. Change the toolbar button name from the default name to "disable dupes" (without quotes).
Tried exactly this, but it only worked in the context menus. Tried it again today, and now it works. Could have been one of those updates, which were released several times yesterday (about every 30 minutes).


Quote:
Originally Posted by mgpai View Post
Since the script will overwite any custom comments set by the user, it is disabled by default (commented out). Uncomment the relevant code. For e.g, change:
Code:
//link.comment = "original";
to
Code:
link.comment = "original";
Should have noticed that, as well as the green color - stupid me!

Again, thank you so much for that macro! Whish I would be able to write such macros myself...
Reply With Quote
  #2925  
Old 27.04.2024, 12:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,519
Default

Quote:
Originally Posted by StefanM View Post
Could have been one of those updates, which were released several times yesterday (about every 30 minutes).
No changes from those updates only plugin updates
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2926  
Old 03.05.2024, 19:42
SacredDB SacredDB is offline
Junior Loader
 
Join Date: Oct 2013
Posts: 11
Question Delete empty folder (after files have been moved)?

Hello everyone,

I have written a script which moves downloaded files (which are not an archive) to another directory (the package name remains the same). The script also works. But after moving, the (now) empty folder remains in the original download directory.

That's the script:

Code:
/*
    Move finished non archive files
    Trigger: Download has stopped
*/    
if (link.finished && !link.archive) {
    var downloadFolder = link.package.downloadFolder;
    var newFolder = downloadFolder.split("C:\\Users\\Tom\\Downloads\\JD 2\\").join("C:\\Users\\Tom\\Downloads\\JD 2\\F\\"); // Modify path

    if (newFolder != downloadFolder) {
        getPath(link.downloadPath).moveTo(newFolder);
    }
}
I have tried to write a second script which then deletes the empty folder, but unfortunately not successfully, the script does not work.
Maybe it is possible to combine both functions in one script, but unfortunately I am at a loss here.
Can someone help me?

That's my attempt (not working):
Code:
/*
    Delete empty folder after files have been moved
    Trigger: Download has stopped
*/    
if (link.finished) {
    var downloadFolder = getPath(link.downloadPath); // 
    if (downloadFolder.exists() && downloadFolder.getChildren().length == 0) {
        downloadFolder.delete();
    }
}
Reply With Quote
  #2927  
Old 04.05.2024, 13:08
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,519
Default

@SacredDB: link.downloadpath is the path to the file, not the folder, you need get the parent(folder) of the file like following
Quote:
var downloadFile= getPath(link.downloadPath);
var downloadFolder=downloadFile.getParent();
....
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2928  
Old 05.05.2024, 19:13
SacredDB SacredDB is offline
Junior Loader
 
Join Date: Oct 2013
Posts: 11
Default

Quote:
Originally Posted by Jiaz View Post
@SacredDB: link.downloadpath is the path to the file, not the folder, you need get the parent(folder) of the file like following
Okay, I've missed that.
Got it, now it's working.

Thank you Jiaz!
Reply With Quote
  #2929  
Old 05.05.2024, 21:47
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,519
Default

@SacredDB: you're welcome and thanks for the feedback. maybe wanna share your final scripts and short descriptions, in case other want to achieve similiar thing
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2930  
Old 27.05.2024, 13:38
VanTuz VanTuz is offline
JD Adviser
 
Join Date: Oct 2018
Posts: 110
Default

I don't understand java script programming at all, but I need a script that would put all the files from one post from kemono.su in one folder, no matter what file sharing site they are on. Please help me if it's not difficult.
Reply With Quote
  #2931  
Old 27.05.2024, 14:27
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,112
Default

Context for VanTuz post:
https://board.jdownloader.org/showth...577#post534577
__________________
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
  #2932  
Old 27.05.2024, 21:42
zinillus zinillus is offline
Junior Loader
 
Join Date: Aug 2019
Posts: 11
Default

Hi. I wanted help making a script that is able to take postContentIndex, which returns an index for the order in which an image appears on a page, but zero pads it so the number is always 3 digits. e.g. 001, 002, ..., 011, etc. Instead of the current 1, 2, ..., 11, etc.

More context in this post. Jiaz mentions he's available to clarify details.
https://board.jdownloader.org/showth...712#post534712
Reply With Quote
  #2933  
Old 28.05.2024, 17:59
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by VanTuz View Post
I don't understand java script programming at all, but I need a script that would put all the files from one post from kemono.su in one folder, no matter what file sharing site they are on. Please help me if it's not difficult.
You can create a packagizer rule:
Code:
if > source url contains : kemono.su/*/user/*/post/*
then set > download directory : <jd:source:1> <jd:source:2> <jd:source:3>
then set > package name : <jd:source:1> <jd:source:2> <jd:source:3>
Reply With Quote
  #2934  
Old 28.05.2024, 19:48
VanTuz VanTuz is offline
JD Adviser
 
Join Date: Oct 2018
Posts: 110
Default

Quote:
Originally Posted by mgpai View Post
You can create a packagizer rule:
Code:
if > source url contains : kemono.su/*/user/*/post/*
then set > download directory : <jd:source:1> <jd:source:2> <jd:source:3>
then set > package name : <jd:source:1> <jd:source:2> <jd:source:3>
It didn't work. Or I did something wrong.
Reply With Quote
  #2935  
Old 29.05.2024, 09:30
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,112
Default

@mgpai
Context is missing here - he also wants to put all non-kemono results which are added originally via kemono to be put in one package e.g. also all mega.nz links.
Reference:
https://board.jdownloader.org/showth...577#post534577
__________________
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
  #2936  
Old 29.05.2024, 12:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by pspzockerscene View Post
@mgpai
Context is missing here - he also wants to put all non-kemono results which are added originally via kemono to be put in one package e.g. also all mega.nz links.
It does. It generates a package name from url and puts all files in same package/download folder.

Reply With Quote
  #2937  
Old 30.05.2024, 11:17
VanTuz VanTuz is offline
JD Adviser
 
Join Date: Oct 2018
Posts: 110
Default

So I'm doing something wrong and I don't understand how it should be.
Reply With Quote
  #2938  
Old 30.05.2024, 11:40
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by VanTuz View Post
So I'm doing something wrong and I don't understand how it should be.
Rule is applied only when adding links to JD. If it is still not working, post a screenshot of your packagizer rule.
Reply With Quote
  #2939  
Old 30.05.2024, 12:56
VanTuz VanTuz is offline
JD Adviser
 
Join Date: Oct 2018
Posts: 110
Default

Reply With Quote
  #2940  
Old 30.05.2024, 15:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by VanTuz View Post
...
The packagizer rule works only post url. The test url you have used is profile url. It also did not return any mega links. Email example links to me which return mega links as well for testing.
Reply With Quote
  #2941  
Old 30.05.2024, 16:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by zinillus View Post
a script to take postContentIndex ... zero pads it so the number is always 3 digits
Code:
/*
    pad postContentIndex
    trigger : packagizer hook
*/    

if (linkcheckDone && state == "BEFORE") {
    var current = link.getProperty("postContentIndex");

    if (current != null) {
        var padded = ("000" + current).slice(-3);
        link.setProperty("postContentIndex", padded);
    }
}
Reply With Quote
  #2942  
Old 30.05.2024, 23:45
VanTuz VanTuz is offline
JD Adviser
 
Join Date: Oct 2018
Posts: 110
Default

I checked with a link to a specific post and it worked, but the fact is that I need the name of the post to be in the folder name. Of course, you can make sure that files from the post that are not on the file sharing site fall into a subfolder, but then if there are a lot of folders, then it will be difficult to sort the files by folders. And if there are a lot of pages with posts on the author's page, then even if you use third-party browser add-ons to copy several links at once, it will take a lot of time to copy all the links, and I would like to do something faster, if it is possible in principle.
Reply With Quote
  #2943  
Old 31.05.2024, 08:43
ypp ypp is offline
DSL Light User
 
Join Date: Jan 2019
Posts: 33
Default

is it possible to run an external (python?) script to resolve link? as many sites use cloudflare to block jd now
Reply With Quote
  #2944  
Old 31.05.2024, 09:31
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by ypp View Post
is it possible to run an external (python?) script to resolve link? as many sites use cloudflare to block jd now
You can use callSync and callAsync methods (check built-in help for details) to call external programs from eventscripter.
Reply With Quote
  #2945  
Old 31.05.2024, 12:25
ypp ypp is offline
DSL Light User
 
Join Date: Jan 2019
Posts: 33
Default

yes but you can't change downloadlinks, can only add to linkgrabber and then the packages and filenames will be messed up.
Reply With Quote
  #2946  
Old 31.05.2024, 16:57
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,578
Default

Quote:
Originally Posted by ypp View Post
yes but you can't change downloadlinks, can only add to linkgrabber and then the packages and filenames will be messed up.
Only directhttp links can be modified in GUI. Presently there are no eventscripter methods to do it. You can use addLinksQuery to insert new links in the same package preserving the file name, comment etc., depending on the output returned by your script. You can also use folderwatch MYJD API and add links directly from python script.
Reply With Quote
  #2947  
Old 02.06.2024, 00:42
FBD's Avatar
FBD FBD is online now
JD Fan
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 75
Post Script: Stop downloads during extraction

As the old script in this thread to stop downloads during extraction is not working anymore (producing a deadlock) here's a new one i put together on a user request:

Code:
/* 
    Stop downloads during extraction
    Trigger Required: Any Extraction Event
*/

if (isDownloadControllerRunning() && event == "EXTRACTING") {
    // Extraction starting and download runnning
    stopDownloads();

} else if (!isDownloadControllerRunning() && event == "CLEANUP") {
    // Restart downloads
    startDownloads();
}
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader
Reply With Quote
  #2948  
Old 06.06.2024, 14:19
DamonDragon DamonDragon is offline
DSL User
 
Join Date: Aug 2016
Posts: 38
Default

I wanted to share my script, that will automatically add YouTube thumbnails to the corresponding video File if they are downloaded in the same package. If the thumbnails don't show up in the link crawler, then you have to enable them in the plugin first.

Code:
// Adds Youtube thumbnail to video (requires you to download the video and thumbnail in the same package)
// Should work with pretty much anything else in the package and you can also use as many youtube videos as you like.
// Trigger Required: "Package Finished"
//
// This script uses ffmpeg (ffmpeg.org)
// If not already done set the path to your ffmpeg file under advanced settings(ffmpegSetup: binary path)
//
// Aditional Info:
// You can select which types you want the linkcrawler to grab under the youtube pluging. For example mp4 + jpg
//
// Detailed description:
// Looks for all mp4 files in a package; compares the ContainerURL with all images in the package (img/png);
// if the matching thumbnail is found copies the video and adds the thumbnail to the copy;
// deletes the video without thumbnail and the thumbnail itself; renames the copied video to the original name
//
// Author @DamonDragon
//
// More event scripts can be found here: https://board.jdownloader.org/showpost.php?p=453474
//
// For debugging you can use:
// writeFile(JD_HOME + "/log_script_youtube_thumbnail_adder.txt", variable + "random text\n", true /*bool append*/ );
//
var links = package.getDownloadLinks();
var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath");

// delete file without recursion
function deleteOriginalFile(filePath) {
    deleteFile(filePath, false);
}

// check all package links for youtube videos (MP4-Files)
for (var i = 0; i < links.length; i++) {
    var videoLink = links[i];
    var videoFile = videoLink.getDownloadPath();

    // only looks for mp4 files from youtube.com 
    // I only tried this script with mp4 files and I'm not sure if ffmpeg works for FLV or MKV,
    // but if it works or you want to try, you can repace "mp4" with "(mp4|flv|mkv)" for example.
    if (videoLink.getHost() == "youtube.com" && /\.mp4$/i.test(videoFile)) {
        var videoURL = videoLink.getContainerURL();
        var imageFile = null;
        var thumbnail = false;

        // search for fitting thumbnail that has the same download url as the MP4-File
        for (var j = 0; j < links.length; j++) {
            var imageLink = links[j];
            var tempImageFile = imageLink.getDownloadPath();
            var imageURL = imageLink.getContainerURL();

            // only looks for jpg and png files that are from youtube.com
            // compares the imageURL with the videoURL. If they match then this should be the thumbnail for the video.
            if (imageLink.getHost() == "youtube.com" && /\.(jpg|png)$/i.test(tempImageFile) && imageURL == videoURL) {

                thumbnail = true;
                imageFile = tempImageFile;

                // The additional if is needed in case you have multiple videos/images with
                // the same name and used "rename". This might execute the break on the first found thumbnail,
                // that had the same name instead of the renamed one.
                if (getPath(imageFile).exists() && getPath(videoFile).exists()) {
                    break;
                }
            }
        }

        // copy video and add thumbnail if there is a matching thumbnail
        // checks if the image and the video are localy saved and not only in the package
        // (prevents the video file from getting deleted if the image isn't locally saved)
        if (thumbnail && getPath(videoFile).exists() && getPath(imageFile).exists()) {

            // Get original file extension
            var originalExtension = videoFile.substring(videoFile.lastIndexOf('.'));

            // temp name for the new video that has the thumbnail (will be renamed later)
            var finalVideo = videoFile + ".tmp." + originalExtension;

            // creates a new video (finalVideo) that contains the thumbnail
            callSync(ffmpeg, "-i", videoFile, "-i", imageFile, "-map", "0", "-map", "1", "-c", "copy", "-c:v:1", "png",
                "-disposition:v:1", "attached_pic", finalVideo);

            // save orginal filepath (name)
            var videoPath = getPath(videoFile);

            // delete thumbnail and unedited video (video without thumbnail)
            deleteOriginalFile(videoFile);
            deleteOriginalFile(imageFile);

            // rename to orginal filepath (name)
            getPath(finalVideo).renameTo(videoPath);
        }
    }
}

Last edited by DamonDragon; 06.06.2024 at 14:22.
Reply With Quote
  #2949  
Old 15.06.2024, 17:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,519
Default

@DamonDragon: nice one! we will check if its easy doable to integrate this step with ffmpeg directly into plugin/download of video
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2950  
Old 17.06.2024, 11:25
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 705
Default Script Request about file info in comments

@mpgai
New Script Request


Change of Plan: Just one easy script-job (converting seconds.msec to hh:mm:ss.mesec) remaining which I will post in a new request.

Here you can find my modified and simpler request.

Please disregard below request/specifications


@Jiaz wrote here, that it es possible to write additional file info, such as duration, resolution,… to the comment column in JD.

So, I kindly ask you for your help:

You can request the file info, I want to see as a comment, as follows:

Working Example: (Replace XX with tt)
Request:
Code:
curl -X POST -H "Content-type: application/json" -d "{"id":"ea87de7828fed"}" hXXps://keep2share.cc/api/v2/getFileStatus
Response:
Code:
 {"status":"success","code":200,"name":"alla-2018-540p_full_mp4.mp4","is_available":true,"is_folder":false,"size":127429257,"access":"public","isAvailableForFree":true,"video_info":{"duration":718.12,"width":720,"height":540,"format":"MPEG-4"}}
More Info on keep2share.github.io/api/#chapter:check_link

What I would like to see as comment is this:

true TAB false TAB 127429257 TAB public TAB true TAB 718.12 TAB 720 TAB 540 TAB MPEG4

If TAB-separation is not possible, ";" could be used instaed.

An even better output would be,
if duration could be converted from 718.12 to 0:11:58,120

I would really appreciate your help here!
Thanks for any efforts taken in advance!!!

Last edited by StefanM; 18.06.2024 at 10:50.
Reply With Quote
  #2951  
Old 17.06.2024, 11:38
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,112
Default

@StefanM
This should be possible via simple Packagizer rule though I'm not sure about the tab symbol but you should try that first, see:
https://board.jdownloader.org/showth...437#post535437
__________________
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
  #2952  
Old 17.06.2024, 11:51
StefanM's Avatar
StefanM StefanM is offline
JD Legend
 
Join Date: Oct 2020
Posts: 705
Default

Quote:
Originally Posted by pspzockerscene View Post
@StefanM
This should be possible via simple Packagizer rule though I'm not sure about the tab symbol but you should try that first, see:
**External links are only visible to Support Staff**...
Well, I use the TAB separator with "Copy Information" by inserting "real" tabs between those values I want to separate.

In LinkgrabberContext.menu.json it loks like this:
Code:
{"PATTERNLINKS":"{url}\t{type}\t{name}\t{filesize_raw}\t{path}...
Reply With Quote
  #2953  
Old 17.06.2024, 11:55
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 72,112
Default

Well then I do not see any problems to do this.
Also you do not need to set that information as a comment (except if you want to see it in GUI).
You could just make a custom copy command which includes all of those properties, separated by tabs.
Adding the information for each item as a comment is, strictly saying, just using more RAM.
__________________
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
  #2954  
Old 17.06.2024, 20:21
hulleyrob hulleyrob is offline
JD Alpha
 
Join Date: Dec 2022
Posts: 24
Default

has anyone got an eventscripter script that works with apprise yet?

Ive had a search but was surprised there wasnt anything.

Basically need to recreate this when a download has finished:

curl -X POST -d '{"urls": "mailto://user:pass@gmail.com", "body":"test message"}' \
-H "Content-Type: application/json" \
**External links are only visible to Support Staff****External links are only visible to Support Staff**

Thanks
Reply With Quote
  #2955  
Old 17.06.2024, 20:37
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,519
Default

@hulleyrob: what problem do you have/encounter or where are you stuck?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2956  
Old 17.06.2024, 22:54
hulleyrob hulleyrob is offline
JD Alpha
 
Join Date: Dec 2022
Posts: 24
Default

Not really sure where to start as I dont know javascript.

The problem I want to solve is when a download is finished I want to make a call to apprise which will hand the notification for the finished download.

I thought there maybe something already to do this or that can mimic the curl post call above that I can use.

This call just needs the mailto part of the json replaced with whatever notification service you wish to use and have set up in apprise. The "test message" would be replaced with the name of the download.

If you know of anything that can get me started which can make such a post call from the eventscripter that would be great.

Last edited by hulleyrob; 17.06.2024 at 22:56.
Reply With Quote
  #2957  
Old 17.06.2024, 23:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,519
Default

@hulleyrob, see for example in this thread https://board.jdownloader.org/showpo...6&postcount=22
you can write/edit script and hit the test/run button to see if it works

I will prepare dummy/example by tomorrow
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 17.06.2024 at 23:03.
Reply With Quote
  #2958  
Old 17.06.2024, 23:10
hulleyrob hulleyrob is offline
JD Alpha
 
Join Date: Dec 2022
Posts: 24
Default

Thanks is that a standard JavaScript method?

As it’s not clear where to put headers and where body goes as per the curl example.

I’m really surprised nobody has got one for apprise already as everything seems to use it for notifications nowadays.

If you can do an example tomorrow that would be great.
Reply With Quote
  #2959  
Old 17.06.2024, 23:12
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 80,519
Default

@hulleyrob: I will try to create simply curl compatibilty to make it easier for others to use. right now it's not possible to set custom headers. I will work on this as well.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2960  
Old 17.06.2024, 23:24
hulleyrob hulleyrob is offline
JD Alpha
 
Join Date: Dec 2022
Posts: 24
Default

Actually I had overcomplicated it which wasnt helping I could have sent everything inline.

This example pass the test event and send a message successfully:

postPage('**External links are only visible to Support Staff**,
"urls=synology://192.168.0.4:5000/APPRISE_SYNOLOGY_TOKEN_REMOVED&body="
+ package.getName() +
" finished.");

This works fine apprise (running in docker) is getting the message and passing it on to Synology chat.

Thanks for your help.
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 23:42.
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.