download all if more than one post found

This commit is contained in:
karl.hudgell 2022-06-18 10:08:05 +01:00
parent a2f3a9ee69
commit 8b0040d8dd

View File

@ -17,8 +17,9 @@ async function filterFeed() {
// Find show on feed
let list_filtered_for_show = feed.filter(item => item.title.includes(show.Name))
if (list_filtered_for_show.length > 0) {
for (let match of list_filtered_for_show) {
// If show is found get url then return all links on that page
let full_link_list_from_page = await getLinksFromURL(list_filtered_for_show[0].link)
let full_link_list_from_page = await getLinksFromURL(match.link)
if (hevcSwitch) {
// Only get urls with HEVC in name
urls_to_check = full_link_list_from_page.filter(item => item.includes('HEVC'))
@ -42,10 +43,11 @@ async function filterFeed() {
// NitroFlare doesn't group with the rest of the links in JD, remove them.
let remove_nitroflare = pre_nitroFlare.filter(item => !item.includes('nitro'))
// Do some stuff
let download_list = checkFileName(remove_nitroflare)
urlObj = checkFileName(remove_nitroflare)
let download_list = urlObj.urlList
// Send Links to JDdownloader
if (download_list.length !== 0) {
log.info(download_list.length + ' links for ' + show.Name + ' have been sent to JDdownloader')
log.info(download_list.length + ' links for ' + urlObj.fileName + ' have been sent to JDdownloader')
linkAdder(download_list)
} else {
// No HEVC links found
@ -54,6 +56,7 @@ async function filterFeed() {
retry_show_cache.push(feed_item)
}
}
}
} else {
// Show not found on the current feed cache
log.info(show.Name + ' not on feed')