JDRssDownloader/jd-link-adder.js

17 lines
514 B
JavaScript
Raw Normal View History

2022-06-08 12:28:30 +01:00
const { JDownloaderClient } = require('jdownloader-client')
const fs = require("fs");
async function linkAdder(links) {
const client = new JDownloaderClient(process.env.JDUSERNAME, process.env.JDPASSWORD)
await client.connect()
const devices = await client.listDevices()
const addLinks = await client.linkGrabberAddLinks(devices[0].id, {
links: links,
autostart: JSON.parse(fs.readFileSync('config.json')).Autostart
})
}
module.exports = {
linkAdder
}