Skip to content

Commit

Permalink
Fixed quality fallback selecting lowest quality instead of highest
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Apr 7, 2022
1 parent 4e4b03a commit 3045923
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/Video.ts
Expand Up @@ -176,7 +176,7 @@ export default class Video {
const availableQualities = cdnInfo.resource.data.qualityLevels.map((quality) => quality.name).sort((a, b) => +b - +a);

// Set the quality to use based on whats given in the settings.json or the highest available
const downloadQuality = availableQualities.includes(quality) ? quality : availableQualities[availableQualities.length - 1];
const downloadQuality = availableQualities.includes(quality) ? quality : availableQualities[0];

const downloadRequest = fApi.got.stream(
`https://${downloadEdge.hostname}${cdnInfo.resource.uri.replace('{qualityLevels}', downloadQuality).replace('{token}', cdnInfo.resource.data.token)}`,
Expand Down

0 comments on commit 3045923

Please sign in to comment.