JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1861  
Old 11.09.2021, 02:44
fuknuckle fuknuckle is offline
Black Hole
 
Join Date: Aug 2015
Posts: 253
Default

@mgpai

Helo script master!

I need your skills. I inquired about if JD had a way of importing hoster accounts en mass and Jiaz said you may be able to help that.

what I would like to do is have a bunch of accounts in a text document with a pattern like "username:password@domain" (as suggested by Jiaz) and then when those are copied to the clipboard, your scrip would use the JD API to import them.

Bonus if you can make a simple script that automatically does a staggered refresh (does the login check) of accounts of a specific hoster in batches every X days
Reply With Quote
  #1862  
Old 11.09.2021, 12:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by fuknuckle View Post
.. have a bunch of accounts in a text document with a pattern like "username:password@domain" (as suggested by Jiaz) ... use the JD API to import them.
Since the passwords can contain ":" as well as "@" character, the script uses "\t" as separator. No need to use the actual "\t" escape code to separate the values in the text file. Just use 'tab' key on keyboard.

Code:
/*
    Import accounts from text/csv file
    Login details should be in hoster\tusername\tpassword (tsv format), 1 per line
    Set path to text file and click 'test run' button to import the accounts
*/

var myfile = "c:/downloads/accounts.txt";

try {
    readFile(myfile).trim().split("\r\n").forEach(function(item) {
        callAPI("accounts", "addAccount", item.split("\t"));
    });
} catch (e) {
    alert(e.message);
};

Quote:
Originally Posted by fuknuckle View Post
Bonus if you can make a simple script that automatically does a staggered refresh (does the login check) of accounts of a specific hoster in batches every X days
JD automatically refreshes the accounts at regular intervals. Also, it is possible to sort the accounts by name or status and easily select and refresh them manually. I am hence, declining this request.
Reply With Quote
  #1863  
Old 12.09.2021, 20:58
sabot105mm sabot105mm is offline
Modem User
 
Join Date: Jan 2021
Posts: 1
Default

@mgpai
I'm trying to figure out how I could get jdownloader to peek inside archive then move the archive based on the contents file format without extracting content.

say I have a archive named
Spoiler:
ASUS RADEON ROG MATRIX R9 290X PLATINUM (C671X) REV 1.00X 59YV05D1-VG0A01S
, and would like the archive moved to a folder named boardview in the case when the contents of the archive contain file format .fv or .cad.
I'm sure this needs to be a script but I have no idea how, could you help?
Reply With Quote
  #1864  
Old 13.09.2021, 08:08
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by sabot105mm View Post
... and would like the archive moved to a folder named boardview in the case when the contents of the archive contain file format .fv or .cad.
You can use a 3rd party CLI utitlity in the script to list/check the contents of the archive file. Most archive softwares come with one. Find such a command which works in the terminal window and post it here.

Some examples:
Code:
7za l myarchive.zip
unrar l myarchive.rar
Reply With Quote
  #1865  
Old 16.09.2021, 15:26
pivor pivor is offline
Vacuum Cleaner
 
Join Date: Apr 2013
Posts: 15
Default

Hello, can i request a script that would save download link (in a txt file), next to downloaded content?
Example:
c:/download/content1
c:/download/content1/content1_links.txt
c:/download/content2
c:/download/content2/content2_links.txt

Thank you in advance!
Reply With Quote
  #1866  
Old 16.09.2021, 15:50
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by pivor View Post
... script that would save download link (in a txt file), next to downloaded content?
Code:
/*
    Save links to text file
    Trigger : Package Finished
*/

var content = [];
var file = package.downloadFolder + "/" + package.name + "_links.txt";

package.downloadLinks.forEach(function(link) {
    content.push(link.contentURL || link.pluginURL);
})

content = content.join("\r\n") + "\r\n";

writeFile(file, content, true);
Reply With Quote
  #1867  
Old 16.09.2021, 16:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,342
Default

@mgpai: maybe for download finished?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1868  
Old 16.09.2021, 16:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: maybe for download finished?
Quote:
Originally Posted by pivor View Post
... i want to save link for each package i download.
Created based on original request. But sure, I can be modify it if the user wishes urls to be saved on per link basis.
Reply With Quote
  #1869  
Old 16.09.2021, 16:42
pivor pivor is offline
Vacuum Cleaner
 
Join Date: Apr 2013
Posts: 15
Default

yeah, for finished download, or while downloading, thank you
Reply With Quote
  #1870  
Old 16.09.2021, 17:08
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by pivor View Post
yeah, for finished download, or while downloading, thank you
I had created the script based on your original request. If you state your request clearly, it will save me time/effort.

Code:
/*
    Save finsihed link
    Trigger : A download stopped
*/

if (link.finished) {
    var package = link.package;
    var file = package.downloadFolder + "/" + package.name + "_links.txt";
    var url = link.contentURL || link.pluginURL;

    writeFile(file, url + "\r\n", true);
}
Reply With Quote
  #1871  
Old 16.09.2021, 20:45
pivor pivor is offline
Vacuum Cleaner
 
Join Date: Apr 2013
Posts: 15
Default

sorry for asking question here, but event scripter doesent work at all for me, like, nothing happens, its installed, enabled, i added scripts, test compile is succesful, but test run does nothing and nothing happens after download :(

edit: fixed it

script works but kinda not exactly how i wanted (my bad, should be more specific), right now it saves links for each file so when package has 1000 files, there will be 1000 links (actually one link but with '?' separating file links).

The way i wish it would work is, like i do it manually:

- Context menu on package -> Properties -> Show Download URLs
- Select all -> copy (if one link shows multiple times, only one will be copied to clipboard, so theres no dupes)
- make links.txt file in download/content directory, paste links and save

Its mostly one link per package, thank you, been using JD for 7 years, never figured ES :C.

Last edited by pivor; 16.09.2021 at 21:06.
Reply With Quote
  #1872  
Old 16.09.2021, 21:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by pivor View Post
script works but kinda not exactly how i wanted
Find me in JD Chat. I make the necessary modifications based on your live feedback.

Code:
kiwiirc.com/nextclient/irc.libera.chat/#jdownloader
Reply With Quote
  #1873  
Old 24.09.2021, 10:37
dariotoby dariotoby is offline
Baby Loader
 
Join Date: Nov 2018
Posts: 5
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    Write info to text file
    Trigger:  A Download stopped
*/

if (link.finished) {
    var name = link.name;
    var url = link.contentURL || link.pluginURL;
    var data = [name, url];

    var file = "linkInfo";
    var folder = link.package.downloadFolder;
    var filePath = getPath(folder + "/" + file + ".txt");

    writeFile(filePath, data.join(", ") + "\r\n", true);
}
I wanted to know if you could change this script so that the TXT file wrote it when the files are loaded in the Capture Links window not after downloading?
Then if you could write in this format: "file name (without extension), file extension, download link"
Reply With Quote
  #1874  
Old 24.09.2021, 11:47
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by dariotoby View Post
I wanted to know if you could change this script so that the TXT file wrote it when the files are loaded in the Capture Links window not after downloading?
Then if you could write in this format: "file name (without extension), file extension, download link"
Text file will have to be created in static/default download folder, since the download folder for links are only set when they are added to download list and any missing folders will be created at the time of download.

Only data available at the time of adding the links can be saved, which may not be accurate if the link available status in 'unknown'.
Reply With Quote
  #1875  
Old 24.09.2021, 12:58
dariotoby dariotoby is offline
Baby Loader
 
Join Date: Nov 2018
Posts: 5
Default

Quote:
Originally Posted by mgpai View Post
Text file will have to be created in static/default download folder, since the download folder for links are only set when they are added to download list and any missing folders will be created at the time of download.

Only data available at the time of adding the links can be saved, which may not be accurate if the link available status in 'unknown'.
For the file save folder I thought it had to change.
So you can save the data to add the link? If you are okay, if the connection is unknown so not working, will still be inserted?
In this case if you can't jump it? or in any case report it as "unknown"?
Reply With Quote
  #1876  
Old 24.09.2021, 13:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by dariotoby View Post
... save the data to add the link?
Code:
/*
    Log crawledlink info to file
    Trigger : A new link has been added
    Important: Disable synchronous execution checkbox in top panel
*/

var myFile = "c:\\downloads\\crawledlinks.txt";
var link = crawledLink;
var name = link.name;
var ext = "none";
var status = link.availableState;
var url = link.contentURL || link.pluginURL;
var full, data;

try {
    [full, name, ext] = link.name.match(/(.+)\.(.+)/);
} catch (e) {};

data = [name, ext, url, status];
data = data.join(",") + "\r\n";

writeFile(myFile, data, true);

If you need any modifications, find me in JD Chat.
Reply With Quote
  #1877  
Old 29.09.2021, 16:04
mirino mirino is offline
JD VIP
 
Join Date: Mar 2009
Posts: 365
Default Hat jemand Zeit ein EventScripter Script zu erstellen?

Ich schaffe es zZt. zeitlich nicht, ein EventScripter Script zu erstellen. Hat vielleicht jemand Zeit und Lust das zu machen? Ich möchte eine Textdatei (.txt) mit folgendem Inhalt (so ähnlich wie das JDownloader bei youtube bereits macht):

1. Zeile der Link:
auf1. eu/videos/watch/413e81fe-10c8-45f5-b2fd-5bdd274da888?title=0&warningTitle=0&peertubeLink=0

Die nächsten Zeilen: Der Text aus der Video-Beschreibung (= als Kommentar gesetzt).


Diesen "/videos/watch"-URL bekomme ich darüber, dass ich im Kontextmenü des Vids Video-URL kopieren auswähle, ausgehend von der Seite:
auf1. tv/aufrecht-auf1/ernst-wolff-im-interview-welche-minderheit-uns-lenkt-und-was-sie-will/
Kann man so eine "/videos/watch"-URL auch über einen EventScripter-Script-Befehl, bekommen und weiterverarbeiten?

PPS: Hier ist noch ein weiterer Thread zum Thema:
https://board.jdownloader.org/showthread.php?t=70525

PPPS: @ mgpai: Danke, falls du irgendwann Zeit findest, mir dabei zu helfen

Last edited by mirino; 29.09.2021 at 17:10.
Reply With Quote
  #1878  
Old 29.09.2021, 16:10
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,140
Default

EventScripter Threads zusammengeführt.

@mirino
Ich empfehle, einen Testlink zur Verfügung zu stellen mit dem unser Plugin auch umgehen kann (siehe meine Antwort im anderen Thread...).

Grüße, psp
__________________
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
  #1879  
Old 29.09.2021, 16:30
mirino mirino is offline
JD VIP
 
Join Date: Mar 2009
Posts: 365
Default

Ich habe gerade meinen Post editiert. Ich hoffe jetzt ist alles notwendige drin.

Danke fürs Zusammenführen
Reply With Quote
  #1880  
Old 29.09.2021, 16:35
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,140
Default

Das wichtigste fehlt:
Du möchtest ein EventScripter Script, das die Beschreibung des Videos (= als Kommentar gesetzt) als .txt Datei speichert.

Falls mgpai Zeit findet, wird er dir sicher helfen.

Grüße, psp
__________________
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
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 12:02.
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.