View Single Post
  #1862  
Old 11.09.2021, 11:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,553
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