Clear cache before parsing each playlist

This commit is contained in:
freearhey 2019-08-08 02:43:43 +03:00
parent 92d8bd9899
commit 54b30b8af5
2 changed files with 7 additions and 2 deletions

View File

@ -15,11 +15,14 @@ async function main() {
let countries = playlist.items let countries = playlist.items
if(debug) { if(debug) {
console.log('Debug mode is turn on') console.log('Debug mode is turn on')
countries = countries.slice(0, 1) // countries = countries.slice(0, 1)
// countries = [{ url: 'channels/ru.m3u' }] countries = [{ url: 'channels/ru.m3u' }, { url: 'channels/ua.m3u' }]
} }
for(let country of countries) { for(let country of countries) {
console.log(`Clear cache...`)
util.clearCache()
console.log(`Parsing '${country.url}'...`) console.log(`Parsing '${country.url}'...`)
const playlist = util.parsePlaylist(country.url) const playlist = util.parsePlaylist(country.url)

View File

@ -24,6 +24,8 @@ function main() {
} }
for(let country of countries) { for(let country of countries) {
console.log(`Clear cache...`)
util.clearCache()
console.log(`Parsing '${country.url}'...`) console.log(`Parsing '${country.url}'...`)
const playlist = util.parsePlaylist(country.url) const playlist = util.parsePlaylist(country.url)