Update format.js
- check if the channel already has the resolution specified - small refactoring
This commit is contained in:
parent
86f42c49ee
commit
96837d3753
|
@ -118,13 +118,13 @@ async function detectResolution(playlist) {
|
|||
const results = []
|
||||
for (const channel of playlist.channels) {
|
||||
bar.tick()
|
||||
const url = channel.url
|
||||
if (!channel.resolution.height) {
|
||||
const response = await instance
|
||||
.get(url)
|
||||
.get(channel.url)
|
||||
.then(utils.sleep(config.delay))
|
||||
.catch(err => {})
|
||||
if (response) {
|
||||
if (response.status === 200) {
|
||||
|
||||
if (response && response.status === 200) {
|
||||
if (/^#EXTM3U/.test(response.data)) {
|
||||
const resolution = parseResolution(response.data)
|
||||
if (resolution) {
|
||||
|
|
Loading…
Reference in New Issue