mirror of
https://github.com/karl0ss/JDRssDownloader.git
synced 2025-04-27 20:03:40 +01:00
add logger
This commit is contained in:
parent
68a0be65f5
commit
90e803dadb
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ node_modules
|
|||||||
releasebb.json
|
releasebb.json
|
||||||
config.json
|
config.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
jdrssdownloader.log
|
||||||
|
5
feed.js
5
feed.js
@ -1,6 +1,7 @@
|
|||||||
const extractUrls = require("extract-urls");
|
const extractUrls = require("extract-urls");
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const { linkAdder } = require('./jd-link-adder');
|
const { linkAdder } = require('./jd-link-adder');
|
||||||
|
const log = require('simple-node-logger').createSimpleLogger('jdrssdownloader.log');
|
||||||
|
|
||||||
function filterFeed(fileName) {
|
function filterFeed(fileName) {
|
||||||
let myshowlist = JSON.parse(fs.readFileSync('config.json')).Shows
|
let myshowlist = JSON.parse(fs.readFileSync('config.json')).Shows
|
||||||
@ -13,10 +14,10 @@ function filterFeed(fileName) {
|
|||||||
let urls_with_HEVC_in_url = extracted_urls_for_show.filter(item => item.includes('HEVC'))
|
let urls_with_HEVC_in_url = extracted_urls_for_show.filter(item => item.includes('HEVC'))
|
||||||
let urls_with_720_in_url = urls_with_HEVC_in_url.filter(item => item.includes(JSON.parse(fs.readFileSync('config.json')).Quality))
|
let urls_with_720_in_url = urls_with_HEVC_in_url.filter(item => item.includes(JSON.parse(fs.readFileSync('config.json')).Quality))
|
||||||
let urls_without_torrent_in_url = urls_with_720_in_url.filter(item => !item.includes('torrent'))
|
let urls_without_torrent_in_url = urls_with_720_in_url.filter(item => !item.includes('torrent'))
|
||||||
console.log(urls_without_torrent_in_url)
|
log.info(show + ' - ' + urls_without_torrent_in_url)
|
||||||
linkAdder(urls_without_torrent_in_url)
|
linkAdder(urls_without_torrent_in_url)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(show + ' not on feed')
|
log.info(show + ' not on feed')
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"dotenv": "^16.0.1",
|
"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",
|
||||||
|
"simple-node-logger": "^21.8.12"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user