JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #2641  
Old 23.06.2023, 12:28
Anavigi Anavigi is offline
I will play nice!
 
Join Date: Jul 2020
Posts: 4
Default

Hey folks,

is there a way to execute one of the other scripts from within a script?

Background: I have a script running on interval that I would also like to run when I start the download controller. However, I don't want to copy-past the script and do every change to it twice.

I don't really care whether it's via the file system or via internal reference. Example code would be appreciated.

Thanks in advance!
Reply With Quote
  #2642  
Old 26.06.2023, 16:30
jaypie jaypie is offline
I will play nice!
 
Join Date: May 2022
Posts: 6
Default

Quote:
Originally Posted by pspzockerscene View Post
@jaypie
Du scheinst die Kommentare am Anfang des Scriptes nicht gelesen zu haben.
Per default wird die Datei nur geschrieben, wenn das Paket ein Kommentar hat.


Bei mir funktionierte das Script einwandfrei!
Du hast natürlich absolut Recht, ich dachte schon dass das ja wohl nicht sein kann und ich auf dem Schlauch stehe. Vielen Dank für den Hinweis!:thumbup:
Reply With Quote
  #2643  
Old 29.06.2023, 13:18
lollos lollos is offline
Modem User
 
Join Date: Jun 2023
Posts: 1
Default

hallo and really sorry
i'm really new on scripting but this is the only solution to solve my problem..
i need a script to crawl link at file (ie k2s or rapidagtor or others) from a forum thread (100+ pages)
the site si something like this (don't need login for read) **External links are only visible to Support Staff****External links are only visible to Support Staff** i looking around on the forum but don't find what i need , normal copy/paste limit the research only on fst page... can please you help me?

ty vm

Last edited by lollos; 29.06.2023 at 13:40.
Reply With Quote
  #2644  
Old 29.06.2023, 15:43
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,913
Default

@lollos
A script is not really needed in this case as that website is a super simple website.
You should be able to make this work with 1-2 LinkCrawler rules.

If you fail to do so, you can still use this method.
__________________
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
  #2645  
Old 04.07.2023, 09:56
Anavigi Anavigi is offline
I will play nice!
 
Join Date: Jul 2020
Posts: 4
Default

Quote:
Originally Posted by Anavigi View Post
is there a way to execute one of the other scripts from within a script?
Looks like that's not really possible, huh?
Reply With Quote
  #2646  
Old 08.07.2023, 15:43
Nimboid Nimboid is offline
Vacuum Cleaner
 
Join Date: Jan 2023
Location: UK
Posts: 18
Default Possible to use DOMImplementation createHTMLDocument() ?

Having received HTML in a script, is it possible to use it to create a DOM object on which methods such as querySelector() can be used?

If it's not possible natively (it doesn't seem to be, according to my attempts, code below), is there a technique to import the capability?

Code:
var doc = fromHTML(<HTML_Page>);
var cap = doc.querySelector(".post__content").innerText;
alert(cap);


function fromHTML(sourceText) {
	var doc = document.implementation.createHTMLDocument('TEST');
	doc.open();
	doc.write(sourceText); // sourceText is a fully formed entire page.
	doc.close();
	return doc;
}
Reply With Quote
  #2647  
Old 09.07.2023, 15:45
Notefijes Notefijes is offline
Modem User
 
Join Date: Jul 2023
Posts: 3
Default

**External links are only visible to Support Staff****External links are only visible to Support Staff**
Reply With Quote
  #2648  
Old 09.07.2023, 15:50
Notefijes Notefijes is offline
Modem User
 
Join Date: Jul 2023
Posts: 3
Default Como pasar a MP3 en 2023 🎬🔗

Hi guys! ��

Look for the video in which I explain this on my YouTube channel: Notefijes

**External links are only visible to Support Staff****External links are only visible to Support Staff**

I bring you a video tutorial in which I explain how to convert the audio of your downloads directly to .MP3 format. ✨ from JDownloader. Sometimes we download videos and we just want to listen to the music, right? Well, with this tutorial you are going to become a crack in the subject and you will learn to do it in an easy way.

In the video I show you a perfect tool to extract the audio from any video you download with JDownloader and save it in .MP3, so forget about looking for other converters online. Everything you need is one click away.

Don't worry if you're new to this, because the tutorial is intended for everyone, from the novice to the most experienced in the field. I explain everything step by step, very clearly, and I show you all the necessary options in JDownloader so that you become an expert in audio conversion.

If you have any questions, comments or anything you want to share, leave me your comments below the video. I will be waiting to answer you and give you a hand in whatever you need. ❓

Do not miss this tutorial, it will save you on more than one occasion and you will get the most out of your downloads with JDownloader!

Last edited by Notefijes; 09.07.2023 at 15:54.
Reply With Quote
  #2649  
Old 10.07.2023, 14:51
markifi markifi is offline
Baby Loader
 
Join Date: May 2020
Posts: 8
Default

how do i do an if statement based on the downloaded file's size? i'm thinking using du somehow but i'm so unfamiliar with event scripter i thought i'd ask here.

i've been using
Quote:
var player = "mpv";
var file = getPath(link.getDownloadPath());
callAsync(null, player, file);
on package finished to play finished videos immediately and it works nicely. my filenames are formatted like *ID*.*EXT* for youtube videos which will be relevant below here. i want to re-write this so it works just like as it does now for long videos, but if the file is smaller than 1 MB it opens up
Quote:
callAsync(null, "streamlink", "youtube.com/watch?q=", filenamewithoutextension, "best");
// somehow no space between the youtube url and the file name
this way i could copy livestream links as i do normal videos, and instead of playing the little 500 KB file that jdownloader saves on currently live youtube links, it would just start playing the livestream.

(i'm working with old hardware here and the web playback is choppy, so i got used to this silly way of doing it, instead of playing in the browser, to the point i actually prefer it now)
Reply With Quote
  #2650  
Old 11.07.2023, 20:34
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,913
Default

Quote:
Originally Posted by markifi View Post
this way i could copy livestream links as i do normal videos, and instead of playing the little 500 KB file that jdownloader saves on currently live youtube links, it would just start playing the livestream.
Please provide example URLs for that case.
__________________
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
  #2651  
Old 14.07.2023, 10:49
kuitogu67 kuitogu67 is offline
JD Alpha
 
Join Date: Apr 2021
Posts: 21
Default

Hi, I am trying to remove files that contain yesterday's date in the title when crawling them.

This is the basic idea of the code, but it's just a guess. I am not a programmer.
Can you help me?

Code:
const d = new Date();
const aa = d.getDate()-1;
if (crawledlink.includes(aa)) link.remove();
Reply With Quote
  #2652  
Old 21.07.2023, 07:41
DukeM's Avatar
DukeM DukeM is offline
JD Adviser
 
Join Date: Sep 2019
Posts: 113
Default

Hi, I'm pretty sure this has been asked already and I tried searching the thread but having a hard time finding it.

How can I make it so JD2 adds/crawls a specific link at a certain time/interval, then automatically downloading it, and ignoring files that are already in the download list?

Like for example, this would be the link I want to download from: **External links are only visible to Support Staff**...

PW:
Spoiler:
bnb0PVF7zef


At random times during the next few days, new files will be added to that folder so I can't really set a specific time so I guess interval would be better.

Thank you.
Reply With Quote
  #2653  
Old 21.07.2023, 10:04
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,913
Default

@DukeM
You can create a .crawljob and then use an EventScripter script to repeatedly add that again to JD - when more code in that script to eliminate all items which are already in downloadlist.
I'm also pretty sure that someone already posted a script for this but unfortunately I also won't be able to help with it.
Reference regarding Folder Watch addon / crawljob:
https://support.jdownloader.org/Know...3/folder-watch
__________________
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
  #2654  
Old 21.07.2023, 10:12
DukeM's Avatar
DukeM DukeM is offline
JD Adviser
 
Join Date: Sep 2019
Posts: 113
Default

Ooh, haven't tried using FolderWatch yet. Thank you! It was pretty obvious in the description but somehow didn't see that. Lol.

Last edited by DukeM; 21.07.2023 at 10:18.
Reply With Quote
  #2655  
Old 21.07.2023, 10:33
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,913
Default

Just keep in mind that Folder Watch alone will not do what you want - it will process each job only once hence you need more external scripts to accomplish what you want.

Also for adding only "new" items from linkgrabber to downloadlist you'd need a script.
...though I guess if you setup JD to auto move added items from linkgrabber to downloadlist and configure JD to auto delete dupes when moving items to downloadlist, your script wouldn't need to do a lot other than re-adding the link or crawljob every X time.

Settings:
Auto add items added to linkgrabber to downloadlist:
Code:
LinkgrabberSettings.linkgrabberautoconfirmenabled
-> Enable this
Auto delete duplicates when moving items from linkgrabber to downloadlist:
Code:
LinkgrabberSettings.handledupesonconfirmlatestselection
--> Set to "do not add, but remove from linkgrabber"

Those settings are also available in GUI but for me it was easier to look them up in advanced settings atm.
__________________
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
  #2656  
Old 21.07.2023, 11:51
DukeM's Avatar
DukeM DukeM is offline
JD Adviser
 
Join Date: Sep 2019
Posts: 113
Default

Yeah, seems like it isn't as straightforward as I thought. Thanks for the guides though! Will try to figure them all out.
Reply With Quote
  #2657  
Old 21.07.2023, 14:52
kuitogu67 kuitogu67 is offline
JD Alpha
 
Join Date: Apr 2021
Posts: 21
Default

can anyone help?
Thanks

Quote:
Originally Posted by kuitogu67 View Post
Hi, I am trying to remove files that contain yesterday's date in the title when crawling them.

This is the basic idea of the code, but it's just a guess. I am not a programmer.
Can you help me?

Code:
const d = new Date();
const aa = d.getDate()-1;
if (crawledlink.includes(aa)) link.remove();
Reply With Quote
  #2658  
Old 24.07.2023, 20:51
Maxx10 Maxx10 is offline
Modem User
 
Join Date: Jul 2023
Location: Brazil
Posts: 3
Post [Event Scripter] SIMPLE DOWNLOAD HISTORY 2.0

// SIMPLE DOWNLOAD HISTORY 2.0
// Trigger required: A Download Stopped
// Version 2023.07.24 by Maxx10.

if (link.isFinished()) {

var uuid = package.getUUID();
var pkge = package.getName();

var dateNowUTC = new Date().toISOString();
var dateNow = new Date(dateNowUTC);
dateNow.setUTCHours(dateNow.getUTCHours() - 3);
var dateNow = dateNow.toISOString().slice(0, 10);

var timeNowUTC = new Date().toISOString();
var timeNow = new Date(timeNowUTC);
timeNow.setUTCHours(timeNow.getUTCHours() - 3);
var timeNow = timeNow.getUTCHours();

// Get the download added date, date and time.
var addedDateUTC = new Date(package.getAddedDate()).toISOString();
var addedDate = new Date(addedDateUTC);
addedDate.setUTCHours(addedDate.getUTCHours() - 3);
addedDate = addedDate.toISOString();
addedDateGMT = addedDate.slice(0, 10) + " " + addedDate.slice(11, 19) + " GMT-0300 (BRT)";

// Get the finished download, date and time.
var endDownloadDateUTC = new Date(link.getFinishedDate()).toISOString();
var endDownloadDate = new Date(endDownloadDateUTC);
endDownloadDate.setUTCHours(endDownloadDate.getUTCHours() - 3);
endDownloadDate = endDownloadDate.toISOString();
endDownloadDateGMT = endDownloadDate.slice(0, 10) + " " + endDownloadDate.slice(11, 19) + " GMT-0300 (BRT)";

var a /*history folder*/ = "E:\\software dump\\jd2info\\history\" + "\" + dateNow + "\" + timeNow + "h" + "\";
var b /*history file Name */ = uuid + " " + pkge + ".txt";
var c /*download file name*/ = link.getName();

if (!getPath(a).exists()) getPath(a).mkdirs();
writeFile(a + b, addedDateGMT + " | " + endDownloadDateGMT + " | " + c.split(',') + "\r\n", true);
}
Reply With Quote
  #2659  
Old 25.07.2023, 04:01
yps yps is offline
Modem User
 
Join Date: Jul 2023
Posts: 4
Default

Hola,

¿Como puedo hacer justo lo que indico aquí?:

https://board.jdownloader.org/showth...290#post523290

Saludos
Reply With Quote
  #2660  
Old 31.07.2023, 02:02
yps yps is offline
Modem User
 
Join Date: Jul 2023
Posts: 4
Default

Quote:
Originally Posted by yps View Post
Hola,

¿Como puedo hacer justo lo que indico aquí?:

**External links are only visible to Support Staff**...

Saludos
¿Alguien puede ayudarme?
Reply With Quote
  #2661  
Old 02.08.2023, 18:59
OvO OvO is offline
Vacuum Cleaner
 
Join Date: Jun 2018
Posts: 18
Default

Hallo,

normalerweise ist es so, dass der JDownloader den nächsten Download beginnt, wenn der Download des aktuellen Links fehlschlägt.

Für spezielle Downloads nutze ich Jdownloader so, dass er per Event-Scripter den Zeitstempel der Fertigstellung an den Namen hinzufügt, damit fürs spätere Sortieren eine Reihenfolge eingehalten werden kann. Dafür stelle ich auch ein, dass er nur ein Link zur selben Zeit runterlädt.

Nun, wenn Link X mal fehlschlägt und er dann weiterspringt, was bei YT relativ oft passiert, gerät die Reihenfolge natürlich wieder durcheinander.

Könnte mir jemand ein Script dafür schreiben, dass er im Falle eines fehlgeschlagenden Versuchs, die Datei automatisch zurücksetzt und neustartet?

Vielen Dank.

Last edited by OvO; 03.08.2023 at 14:37.
Reply With Quote
  #2662  
Old 08.08.2023, 19:31
Nimboid Nimboid is offline
Vacuum Cleaner
 
Join Date: Jan 2023
Location: UK
Posts: 18
Default Vexed by FilePath objects

I have a situation where Event Script objects are vexing me. My aim is to reconcile the contents of downloaded Packages with what exists on disk after the files have been reviewed, and unwanted ones discarded, or others inserted by other Packages. I am aware of the 'filePath.exists()' method, but mgpai has suggested that 'filePath.getChildren()' method a better solution, in another situation in Post https://board.jdownloader.org/showpo...postcount=1121

I have been trying to use this in my script snippet below, recognising that of the two, it's likely the much more economical with machine resources.
My plan is to loop through whichever of Link list and Disk File list is shorter and check if there's a match in the other list. I'm trying to use the Filesystem Path for the comparison. I believe that is what I've done in the snippet, as demonstrated by the log() responses shown, but the comparison always fails, with two slightly different variations below.

Is there a basic error or misunderstanding getting in my way?

If this is a deadend, I could compare the String representations of the filepath, or use 'filePath.exists()', which of these would be the more efficient?

I tried to use .constructor to throw some light on my comparisons, but that couldn't help. Why?

Code:
// Trigger: Downloadlist context menu button pressed
switch (name) {
    case "LG context menu demo":

        try {
            // dlSelection appears to be the single item under the pointer, even if a range of lines is highlighted
            var myDownloadlistSelection = dlSelection;
            var myFilePackage = myDownloadlistSelection.getContextPackage();

            // Get Links of Package in Downloads list
            var myDownloadLinks = myFilePackage.getDownloadLinks();

            // Get files actually existing in Package's disk Folder 
            var strDlFolder = myFilePackage.getDownloadFolder();
            var folderFPath = getPath(strDlFolder); /*Get a FilePath Object*/
            var filesPresent = folderFPath.getChildren();

            // Get a sample Download Link and its matching File (indexes differ due to file deletions)
            var sampleLink = myDownloadLinks[14];
            var sampleLinkFPath = getPath(sampleLink.getDownloadPath());
            var sampleFile = filesPresent[1];

            log(folderFPath);
            // -> /Volumes/Data1/JD/Test
            log(sampleLink);
            // -> DownloadLink Instance: 18.jpg
            log(typeof(sampleLink));
            // -> object
            log(sampleLink.constructor);
            // -> undefined
            log(sampleFile);
            // -> /Volumes/Data1/JD/Test/18.jpg
            log(typeof(sampleFile));
            // -> object
            log(sampleFile.constructor);
            // -> undefined
            log(sampleLink == sampleFile);
            // -> false								<-- ?
            log(sampleLinkFPath);
            // -> /Volumes/Data1/JD/Test/18.jpg
            log(typeof(sampleLinkFPath));
            // -> object
            log(sampleLinkFPath.constructor);
            // -> undefined
            log(sampleLinkFPath == sampleFile);
            // -> false								<-- ?


        } catch (e) {
            alert(e.message);
        }
        break;
    default:
}

Last edited by Nimboid; 08.08.2023 at 19:48. Reason: Additional query
Reply With Quote
  #2663  
Old 11.08.2023, 16:12
bugnotme bugnotme is offline
BugMeNot Account
 
Join Date: Apr 2013
Posts: 375
Default

Quote:
Originally Posted by Nimboid View Post
... reconcile the contents of downloaded Packages with what exists on disk ...
Code:
dlSelection.packages.forEach(function(package) {
    var files = getPath(package.downloadFolder).children.map(function(file) {
        return file.name + file.size;
    })

    package.downloadLinks.forEach(function(link) {
        if (files.indexOf(link.name + link.bytesTotal) > -1) {
            link.enabled = false;
        }
    })
})
Reply With Quote
  #2664  
Old 13.08.2023, 04:04
Esteban4u Esteban4u is offline
I will play nice!
 
Join Date: Jun 2022
Posts: 3
Default Skip video file downloads that have a shorter playback duration than specified

I'm not even sure if this is possible but I'm hoping the great minds here could write a script that would let JDownloader NOT download video files that are shorter in video playback duration that a specified amount (ex. Don't download video files with a playback duration shorter than 00:05:00 (hh:mm:ss) minutes long.
Reply With Quote
  #2665  
Old 14.08.2023, 13:43
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,913
Default

@Esteban4u
Sure that is possible but first the length of the video needs to be known/stored somewhere.
Are you talking about YT videos or videos of another website?
If you're talking about YT: The length [in seconds] is available as DownloadLink property "YT_DURATION".
__________________
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
  #2666  
Old 14.08.2023, 18:16
Esteban4u Esteban4u is offline
I will play nice!
 
Join Date: Jun 2022
Posts: 3
Default

@pspzockerscene - Yes, kinda, I meant from any website. If there is a method to determine the video length before or even during download, so that JD can either skip or auto-abort the download if it's x minutes and x seconds too short (hh:mm:ss format maybe).
Reply With Quote
  #2667  
Old 14.08.2023, 18:26
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,913
Default

Well each plugin is using custom properties to store such information.
I'd say most plugins are not saving this information at this moment which is why I asked.

You will need to ask us to add/store this information on a per-website/plugin basis.
At this moment you might first want to get your script working and test it with YT - you can use it for other websites afterwards.
More about custom plugin properties:
https://support.jdownloader.org/Know...-packagizer/20
-> Search for "Plugin specific properties"
__________________
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
  #2668  
Old 22.08.2023, 18:34
FBD's Avatar
FBD FBD is offline
Mega Loader
 
Join Date: Nov 2018
Location: https://web.libera.chat/#jDownloader
Posts: 65
Default Script: Copy selected links from the download list back to the linkgrabber

For anyone who finds that useful:

Code:
// Copy links back to LinkGrabber {by fbd - github.com/FarBeyondDriven/JDscripts}
// 
// Trigger : "DownloadList Contextmenu Button Pressed"
//
// Add a custom menu entry to the DownloadList Context menu, name it "Copy to LinkGrabber"
// (or to any other name, that you also need to customize below)

disablePermissionChecks();

if (name == "Copy to LinkGrabber") {
    var links = dlSelection.getDownloadLinks();

    for (i = 0; i < links.length; i++) {
        var link = links[i];

        var urls = []; // try to get all urls that the link has associated
        if (link.getContentURL()) { urls.push(link.getContentURL()); }
        if (link.getContainerURL()) { urls.push(link.getContainerURL()); }
        if (link.getOriginURL()) { urls.push(link.getOriginURL()); }
        if (link.getUrl()) { urls.push(link.getUrl()); }
        if (link.getPluginURL()) { urls.push(link.getPluginURL()); }
        
        var myFilePackage = link.getPackage();

        callAPI("linkgrabberv2", "addLinks", {
            "deepDecrypt": false,
            "packageName": myFilePackage.getName(),
            "destinationFolder": myFilePackage.getDownloadFolder(),
            "links": urls.join("\r\n")
        });
    }
}
__________________
irc.libera.chat #jDownloader web.libera.chat/#jDownloader

Last edited by FBD; 07.11.2023 at 02:59. Reason: Typos
Reply With Quote
  #2669  
Old 26.08.2023, 03:59
marko117 marko117 is offline
Junior Loader
 
Join Date: Jul 2017
Posts: 10
Default Delete duplicate URL/link/files

Hi everyone. I would need a script that iterates through all the links/urls of my DownloadList and deletes subsequent duplicates once it finds the first one (which is kept) from the list alone. Any file on the disk is not deleted


Package1
--file1(url.com/file/1) FIRST -> it is not deleted
--file2(url.com/file/2) FIRST -> it is not deleted
--file3(url.com/file/3) FIRST -> it is not deleted
--file1(url.com/file/1) DUPLICATE-> TO DELETE
Package2
--file2(url.com/file/2) DUPLICATE-> TO DELETE
--file4(url.com/file/4) FIRST -> it is not deleted
--file3(url.com/file/3]) DUPLICATE-> TO DELETE
package3
--file2(url.com/file/1) DUPLICATE-> TO DELETE
--file4(url.com/file/4) DUPLICATE-> TO DELETE
--file3(url.com/file/2) DUPLICATE-> TO DELETE
--file3(url.com/file/5) NOT DUPLICATE -> it is not deleted

can someone help me? Has anyone done something like this in this thread before?
Thank you
Reply With Quote
  #2670  
Old 06.09.2023, 22:51
DeathStalker DeathStalker is offline
Linkgrabbing Monster
 
Join Date: Apr 2012
Posts: 88
Default

Hello all!

What I need to do is, I hope, something pretty simple: I need to reverse the current sort order. NOT changing any SORTED BY column (there isn't one!) - just reverse the order things are in in the DOWNLOAD list, nothing more.

From then on, everything should be good. I am NOT a programmer/coder/scripter, so none of this makes any sense to me, and any assistance with this would be GREATLY appreciated! :-)

Thank you!

--- DS

No one can help out? :-(

Last edited by DeathStalker; 09.09.2023 at 23:59.
Reply With Quote
  #2671  
Old 12.09.2023, 18:15
KoneDrat KoneDrat is offline
Modem User
 
Join Date: Sep 2023
Posts: 1
Default Way to Automatically Crawl the Same Webpage and Download All PDFs

Hi,

Sorry if this is a stupid question, this forum is very difficult to navigate and find things on.

One of the things I've most wanted to be able to use JDownloader to do is automatically crawl the same link every day and download all the (new) PDF files found there. It's essentially the most basic usage of JDownloader, it's just that it takes me a lot of time to do manually.

Even if there was some way to make a 'speed-dial' that was a pre-configured set of links and download destinations for those links, that would also be a major step-up for my need.

I have no Javascript experience but I could probably edit a preexisting script if one exists.

Thank you for any help you may provide.
Reply With Quote
  #2672  
Old 13.09.2023, 09:39
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,913
Default

@KoneDrat
Some pages earlier I've already posted some hints on how this is possible with minimum effort as another user posted a similar question.
__________________
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
  #2673  
Old 15.09.2023, 15:30
ShlomiD ShlomiD is offline
Baby Loader
 
Join Date: Sep 2022
Posts: 7
Default

Hi,
I've started using the "auto update on idle" script and I was wondering if it's possible to receive an email after a successful update & restart?
Reply With Quote
  #2674  
Old 19.09.2023, 13:19
0xDEADC0DE 0xDEADC0DE is offline
Junior Loader
 
Join Date: Sep 2021
Posts: 10
Default

I made a script to split a package into single seasons if you are interessted

Code:
// Trigger : Linkgrabber Contextmenu Button Pressed

if ( name == "Split Packages By Season" )
{
    var package = lgSelection.getContextPackage();
    var links = package.getDownloadLinks();
    var maxNrOfSeasons = 20;

    var oldFolder = package.getDownloadFolder();
    var packageName = package.getName();

    var cntalert = 0;

    for ( var Season = 1; Season <= maxNrOfSeasons; Season++ )
    {
        var S = "S" + ("0" + Season).slice(-2);
        var links2 = links;
        var UUIDS = [];

        for ( var i = 0; i < links.length ; i++ )
        {
            var link = links[i];
            var filename = link.getName();
            var ind = filename.toUpperCase().indexOf(S + "E");
            if ( ind < 0 )
            {
                // file not current season
                continue;
            }

            UUIDS.push( link.getUUID() );
        }

        if ( UUIDS.length > 0 )
        {
            var newPackage = packageName + " _ " + S;
            var newFolder = oldFolder + " _ " + S;

            const regex = /(.*)(S\d\d\.-\.S\d\d)(.*)/
            var newPackage2 = packageName.replace( regex, "$1" + S + "$3" );
            if ( newPackage2 != packageName )
            {
                newPackage = newPackage2
                newFolder = oldFolder.replace( packageName, newPackage )
            }

            setNewFolder( UUIDS, newPackage, newFolder );
        }

    }
}

// Add sub folder
function setNewFolder( UUIDS2Move, newPackageName, newFolder )
{
    callAPI( "linkgrabberv2", "movetoNewPackage", UUIDS2Move, [], newPackageName, newFolder );
}
Reply With Quote
  #2675  
Old 21.09.2023, 11:12
Heinz Heinz is offline
JD Alpha
 
Join Date: Feb 2020
Posts: 21
Default

Hi there,

i have a long running script which gets started by a button in toolbar.

Is it possible to stop/exit the script if the button is pressed again? or if another button is pressed?

Code:
if (name == "Test1") {
    var links = getAllDownloadLinks();
    for (i = 0; i < links.length; i++) {
        var link = links[i];
		var waiting = true;            
		while(waiting)   
		{       
			....
			sleep(2000);
		}  
    }
    
    ....
    alert("All Done");
}
Did not find any clues on how to do this.

Is there any method list available anywhere? like api documentation?

Last edited by Heinz; 24.09.2023 at 16:35.
Reply With Quote
  #2676  
Old 30.09.2023, 06:39
ronaldron ronaldron is offline
Junior Loader
 
Join Date: Apr 2020
Posts: 10
Default eventscript to add sourceurl to file metadata?

Hey I'm trying to write an eventscript to add the sourceurl where the file was scraped from to the metadata of the resulting file (e.g. in the comment field).

What would be the best way to do this?
Reply With Quote
  #2677  
Old 10.10.2023, 05:26
yps yps is offline
Modem User
 
Join Date: Jul 2023
Posts: 4
Default

Hola,

Estoy editando el plugin de instagram para que me ponga el nombre como yo quiera según los tag, de esta manera.

*uploader*_*date* - *main_content_id*_*orderid**ext*

Tal que así:

pepito_2023-01-01 - Cm3wOPrM8k9_1.jpg

Pero resulta que cuando hay varias publicaciones con el mismo nombre, añade 1, 2, 3 ... según el número de publicaciones dentro del mismo albúm. Esto lo consigo con el *orderid*, hasta aquí, actúa según lo que he puesto.

Pero cuando hay una publicación con solo un elemento añade 1 cuando yo solo quiero que en este caso no añada el *orderid*, es decir que actué igual que lo hace por defecto.

¿Hay alguna manera para que el *orderid* cuando está definido en personalizado solo se muestre cuando haya más nombres iguales?, es decir varios elementos dentro una misma publicación.

Esto lo consigo dejándolo por defecto sin personalizar. Pero entonces no lo tendría como yo quiero.

¿Como puedo lograrlo a través de un script EventScripter?
Reply With Quote
  #2678  
Old 10.10.2023, 18:54
carretti14 carretti14 is offline
Modem User
 
Join Date: Oct 2023
Posts: 1
Default Delete archives Extracted correctly

Hi everyone.

I would need a script that deletes archives successfully extracted from the download list, older than X days, with the Interval trigger.

The automatic deletion function in the post-extraction option unfortunately, does not delete disabled links.

Thanks to those who will help me:)
Reply With Quote
  #2679  
Old 11.10.2023, 15:13
BeRa BeRa is offline
Junior Loader
 
Join Date: May 2020
Posts: 10
Default

Quote:
Originally Posted by thecoder2012 View Post
Proxies in JDownloader eintragen und freuen. In vielen Fällen ist kein Skript dazu erforderlich, wenn stabile Proxies hinterlegt sind. Die meisten kostenfreien Proxies sind allerdings instabil und oft nicht vertrauenswürdig.


In JDownloader sind dafür White- und Blacklisten je Verbindung (Proxy/IP) vorgesehen.
Welche Besonderheit gibt es bei den gewünschten Hostern? Also wozu genau soll das Skript dienen?


Grundsätzlich ja. Manche Nutzer im JD Forum haben das in diversen Themen auch probiert.
Das Hauptproblem waren stets funktionierende Proxies zu haben, so mehr das Skript verwendet haben, so weniger funktionierte es weil fast alle versuchten die gleichen Proxies aus fragwürdiger Quelle zu nutzen.


Eine qualifizierte Kraft lässt sich mit der Zeit sicher finden.
Hello, so what are the actual solution to get some proxy quite automatically?
i've translated the text above and i'm not sure i've understood all.
Reply With Quote
  #2680  
Old 23.10.2023, 00:18
michaeljh michaeljh is offline
Modem User
 
Join Date: Oct 2023
Location: Los Angeles
Posts: 1
Default

Greetings:
I seek your wisdom.
I am trying to create a script that talks to Home Assistant to turn on my Philips Hue lights to alert me when a download finishes.
Home Assistant has the scene successfully working.✅✅
When executed using a cURL command, it works.✅✅
When I run this JavaScript code in WebStorm, it successfully works.✅✅
Now JDownloader is the challenge.

Code:
const fetch = require("node-fetch");

const url = "**External links are only visible to Support Staff**;
const options = {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer thisismysupersecretlonglivedaccesstokenJpc3MiOiI4MmQyODIz0302ZGU0NDlkODQx14UzMiIsImlhdCI6MTY5NzYxODc1MiwiZXhwIjoyMDEyOTc4NzUyfQ.3ePYuab4RD5Kp7vubRDQ2yCGkPChKmmugrZcldLMRBQ',
    },
};

fetch(url, options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! Status: ${response.status}`);
        }
        return response.json();
    })
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));

I tried to make the code compatible with Event Scripter by asking ChatGPT to create the equivalent code using ES5 and no modules. It gave me this code. When I run it in WebStorm, it does work!

Code:
// var request = require("request");
var request = require("C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\request\\request.js");


var url = "**External links are only visible to Support Staff**;
var options = {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer thisismysupersecretlonglivedaccesstokenJpc3MiOiI4MmQyODIz0302ZGU0NDlkODQx14UzMiIsImlhdCI6MTY5NzYxODc1MiwiZXhwIjoyMDEyOTc4NzUyfQ.3ePYuab4RD5Kp7vubRDQ2yCGkPChKmmugrZcldLMRBQ',
    },
};

request(url, options, function (error, response, body) {
    if (!error && response.statusCode === 200) {
        console.log(body);
    } else {
        console.error('Error:', error);
    }
});

JDownloader says
Code:
TypeError: Cannot read property “strict” from undefined.
What am I doing wrong?

Last edited by michaeljh; 23.10.2023 at 03:43.
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 16:48.
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.