mirror of
https://github.com/karl0ss/JDRssDownloader.git
synced 2025-04-27 20:03:40 +01:00
17 lines
514 B
JavaScript
17 lines
514 B
JavaScript
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
|
|
}
|