mirror of
https://github.com/karl0ss/JDRssDownloader.git
synced 2025-04-27 20:03:40 +01:00
move username/password to config.json
This commit is contained in:
parent
90e803dadb
commit
0a57d0d0f7
@ -1,5 +1,7 @@
|
|||||||
{
|
{
|
||||||
"RSS_Feed": "",
|
"JDUserName": "",
|
||||||
|
"JDPassword": "",
|
||||||
|
"RSSFeed": "",
|
||||||
"Quality": "720",
|
"Quality": "720",
|
||||||
"Autostart": false,
|
"Autostart": false,
|
||||||
"Shows": []
|
"Shows": []
|
||||||
|
@ -3,7 +3,8 @@ const fs = require("fs");
|
|||||||
|
|
||||||
|
|
||||||
async function linkAdder(links) {
|
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()
|
await client.connect()
|
||||||
const devices = await client.listDevices()
|
const devices = await client.listDevices()
|
||||||
const addLinks = await client.linkGrabberAddLinks(devices[0].id, {
|
const addLinks = await client.linkGrabberAddLinks(devices[0].id, {
|
||||||
|
3
main.js
3
main.js
@ -1,5 +1,4 @@
|
|||||||
// Import dependencies
|
// Import dependencies
|
||||||
require('dotenv').config()
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const Parser = require("rss-parser");
|
const Parser = require("rss-parser");
|
||||||
const { filterFeed } = require("./feed");
|
const { filterFeed } = require("./feed");
|
||||||
@ -12,7 +11,7 @@ const { filterFeed } = require("./feed");
|
|||||||
const parser = new Parser();
|
const parser = new Parser();
|
||||||
|
|
||||||
// Get all the items in the RSS feed
|
// 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 = [];
|
let items = [];
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
"author": "Karl0ss",
|
"author": "Karl0ss",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^16.0.1",
|
|
||||||
"extract-urls": "^1.3.2",
|
"extract-urls": "^1.3.2",
|
||||||
"jdownloader-client": "^1.0.0",
|
"jdownloader-client": "^1.0.0",
|
||||||
"rss-parser": "^3.12.0",
|
"rss-parser": "^3.12.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user