move username/password to config.json

This commit is contained in:
Karl0ss 2022-06-08 13:09:23 +00:00
parent 90e803dadb
commit 0a57d0d0f7
4 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,7 @@
{
"RSS_Feed": "",
"JDUserName": "",
"JDPassword": "",
"RSSFeed": "",
"Quality": "720",
"Autostart": false,
"Shows": []

View File

@ -3,7 +3,8 @@ const fs = require("fs");
async function linkAdder(links) {
const client = new JDownloaderClient(process.env.JDUSERNAME, process.env.JDPASSWORD)
const client = new JDownloaderClient(JSON.parse(fs.readFileSync('config.json')).JDUserName, JSON.parse(fs.readFileSync('config.json')).JDPassword)
await client.connect()
const devices = await client.listDevices()
const addLinks = await client.linkGrabberAddLinks(devices[0].id, {

View File

@ -1,5 +1,4 @@
// Import dependencies
require('dotenv').config()
const fs = require("fs");
const Parser = require("rss-parser");
const { filterFeed } = require("./feed");
@ -12,7 +11,7 @@ const { filterFeed } = require("./feed");
const parser = new Parser();
// Get all the items in the RSS feed
const feed = await parser.parseURL(JSON.parse(fs.readFileSync('config.json')).RSS_Feed);
const feed = await parser.parseURL(JSON.parse(fs.readFileSync('config.json')).RSSFeed);
let items = [];

View File

@ -9,7 +9,6 @@
"author": "Karl0ss",
"license": "ISC",
"dependencies": {
"dotenv": "^16.0.1",
"extract-urls": "^1.3.2",
"jdownloader-client": "^1.0.0",
"rss-parser": "^3.12.0",