From e9dea1484eb22492808c554bc0f609c9fcb9493a Mon Sep 17 00:00:00 2001 From: Luca Armaroli Date: Wed, 9 Sep 2020 05:40:25 +0200 Subject: [PATCH] removed bug in quality selection --- src/destreamer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/destreamer.ts b/src/destreamer.ts index db6d06a..f98199a 100644 --- a/src/destreamer.ts +++ b/src/destreamer.ts @@ -189,7 +189,7 @@ async function downloadVideo(videoGUIDs: Array, .filter(playlist => Object.prototype.hasOwnProperty.call(playlist.attributes, 'RESOLUTION')); - if (videoPlaylists.length === 1 || argv.selectQuality === 5) { + if (videoPlaylists.length === 1 || argv.selectQuality === 10) { videoPlaylistUrl = videoPlaylists.pop().uri; } else if (argv.selectQuality === 0) { @@ -201,7 +201,8 @@ async function downloadVideo(videoGUIDs: Array, videoPlaylistUrl = videoPlaylists[promptUser(resolutions)].uri; } else { - const choiche = Math.round((argv.selectQuality * videoPlaylists.length) / 10); + const choiche = Math.round((argv.selectQuality * videoPlaylists.length) / 10) - 1; + logger.debug(`Video quality choiche: ${choiche}`); videoPlaylistUrl = videoPlaylists[choiche].uri; }