Merge branch 'fix-test-timeout-issue'

This commit is contained in:
freearhey 2019-09-29 19:02:18 +03:00
commit 4c8828d41b
1 changed files with 5 additions and 12 deletions

View File

@ -28,7 +28,8 @@ const instance = axios.create({
'Accept-Language': 'en_US',
'User-Agent': 'VLC/3.0.8 LibVLC/3.0.8',
'Range': 'bytes=0-'
}
},
responseType: 'stream'
})
async function test() {
@ -65,22 +66,14 @@ async function test() {
let response = await instance.get(item.url)
let string = response.data.toString()
let head = string.slice(0,7)
if(head !== '#EXTM3U') {
stats.failures++
writeToLog(country.url, 'Wrong content type', item.url)
}
response.data.destroy()
continue
} catch (err) {
if(err.request && ['ECONNRESET'].indexOf(err.code) > -1) continue
stats.failures++
writeToLog(country.url, err.message, item.url)