Fixed test timeout issue

This commit is contained in:
freearhey 2019-09-29 19:01:40 +03:00
parent d1d9604b05
commit be45d37007
1 changed files with 5 additions and 12 deletions

View File

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