mirror of
https://github.com/karl0ss/JDRssDownloader.git
synced 2025-04-27 03:49:23 +01:00
working link deletion
This commit is contained in:
parent
26658fdf8a
commit
0bbd83f375
@ -7,10 +7,11 @@ async function filterFeed() {
|
||||
let myshowlist = JSON.parse(fs.readFileSync('config.json')).Shows
|
||||
let hevcSwitch = JSON.parse(fs.readFileSync('config.json')).OnlyHEVC
|
||||
let feed = JSON.parse(fs.readFileSync('./feedCache.json'));
|
||||
let retry_show_cache = []
|
||||
|
||||
|
||||
if (hevcSwitch) {
|
||||
myshowlist.forEach(async show => {
|
||||
for (let show of myshowlist) {
|
||||
try {
|
||||
// Find show on feed
|
||||
let list_filtered_for_show = feed.filter(item => item.title.includes(show.Name))
|
||||
@ -39,9 +40,11 @@ async function filterFeed() {
|
||||
linkAdder(download_list)
|
||||
} else {
|
||||
// No HEVC links found
|
||||
log.info(download_list.length + ' HEVC links for ' + show.Name + ' have been found')
|
||||
log.info(download_list.length + ' HEVC links for ' + show.Name + ' have been found, will recheck next time.')
|
||||
for (let feed_item of list_filtered_for_show) {
|
||||
retry_show_cache.push(feed_item)
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Show not found on the current feed cache
|
||||
log.info(show.Name + ' not on feed')
|
||||
@ -49,10 +52,9 @@ async function filterFeed() {
|
||||
} catch (error) {
|
||||
log.error('Something went wrong ' + error)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
} else {
|
||||
myshowlist.forEach(async show => {
|
||||
for (let show of myshowlist) {
|
||||
try {
|
||||
// Find show on feed
|
||||
let list_filtered_for_show = feed.filter(item => item.title.includes(show.Name))
|
||||
@ -73,9 +75,11 @@ async function filterFeed() {
|
||||
linkAdder(download_list)
|
||||
} else {
|
||||
// No links found
|
||||
log.info(download_list.length + ' links for ' + show.Name + ' have been found')
|
||||
log.info(download_list.length + ' HEVC links for ' + show.Name + ' have been found, will recheck next time.')
|
||||
for (let feed_item of list_filtered_for_show) {
|
||||
retry_show_cache.push(feed_item)
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Show not found on the current feed cache
|
||||
log.info(show.Name + ' not on feed')
|
||||
@ -83,13 +87,10 @@ async function filterFeed() {
|
||||
} catch (error) {
|
||||
log.error('Something went wrong ' + error)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
log.info('Wiping feed cache')
|
||||
fs.writeFileSync('./feedCache.json', JSON.stringify('[]'));
|
||||
fs.writeFileSync('./feedCache.json', JSON.stringify(retry_show_cache));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
@ -6,6 +6,7 @@ global.log = require('simple-node-logger').createSimpleLogger({
|
||||
timestampFormat: 'YYYY-MM-DD HH:mm:ss.SSS'
|
||||
});
|
||||
|
||||
async function main() {
|
||||
let RSSFeedRefreshMins = JSON.parse(fs.readFileSync('config.json')).RSSFeedRefreshMins
|
||||
let JDPostLinksMins = JSON.parse(fs.readFileSync('config.json')).JDPostLinksMins
|
||||
|
||||
@ -13,5 +14,8 @@ log.info('Refreshing RSS Items every ' + RSSFeedRefreshMins + ' Minutes')
|
||||
log.info('Checking for links and sending to JDdownloader every ' + JDPostLinksMins + ' Minutes')
|
||||
|
||||
|
||||
setInterval(feedUpdater, RSSFeedRefreshMins * 60000);
|
||||
setInterval(filterFeed, JDPostLinksMins * 60000);
|
||||
setInterval(await feedUpdater, RSSFeedRefreshMins * 60000);
|
||||
setInterval(await filterFeed, JDPostLinksMins * 60000);
|
||||
}
|
||||
|
||||
main()
|
Loading…
x
Reference in New Issue
Block a user