Fix crashing

This commit is contained in:
bingus_violet 2024-08-09 05:12:33 -05:00
parent 2cc0fbffcf
commit 374e1f7036
3 changed files with 12 additions and 12 deletions

View file

@ -43,7 +43,7 @@ expressManager.app.get("/download", async (req, res) => {
while (videoFormat == undefined) { while (videoFormat == undefined) {
for (let i = 0; i < info.formats.length; i++) { for (let i = 0; i < info.formats.length; i++) {
const format = info.formats[i]; const format = info.formats[i];
if (format.hasVideo && !format.hasAudio && format.height.toString() == qualityLabel.toString()) { if (format.hasVideo && !format.hasAudio && format.height && format.height.toString() == qualityLabel.toString()) {
videoFormat = format videoFormat = format
continue continue
} }

20
package-lock.json generated
View file

@ -9,7 +9,7 @@
"version": "4.0.0", "version": "4.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@distube/ytdl-core": "^4.13.7", "@distube/ytdl-core": "^4.14.4",
"child_process": "^1.0.2", "child_process": "^1.0.2",
"express": "^4.18.2", "express": "^4.18.2",
"ffmpeg-static": "^5.2.0" "ffmpeg-static": "^5.2.0"
@ -30,9 +30,9 @@
} }
}, },
"node_modules/@distube/ytdl-core": { "node_modules/@distube/ytdl-core": {
"version": "4.13.7", "version": "4.14.4",
"resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.13.7.tgz", "resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.14.4.tgz",
"integrity": "sha512-xpovwZVPwQ0R4Mrwt/fhh1rqmBjiZ5qj30ck5kz+mQJ5XPzW9dUiTDz89qCxO3YvgbCAqaC5BNNnWiFC2uCV5Q==", "integrity": "sha512-dHb4GW3qATIjRsS6VIhm3Pop7FdUcDFhsnyQlsPeXW7UhTPuNS0BmraKiTpFbpp0Ky+rxBQjJBfPRFsM+dT1fg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"http-cookie-agent": "^6.0.5", "http-cookie-agent": "^6.0.5",
@ -40,10 +40,10 @@
"miniget": "^4.2.3", "miniget": "^4.2.3",
"sax": "^1.4.1", "sax": "^1.4.1",
"tough-cookie": "^4.1.4", "tough-cookie": "^4.1.4",
"undici": "^6.19.2" "undici": "five"
}, },
"engines": { "engines": {
"node": ">=16" "node": ">=14.0"
}, },
"funding": { "funding": {
"url": "https://github.com/distubejs/ytdl-core?sponsor" "url": "https://github.com/distubejs/ytdl-core?sponsor"
@ -970,16 +970,16 @@
} }
}, },
"@distube/ytdl-core": { "@distube/ytdl-core": {
"version": "4.13.7", "version": "4.14.4",
"resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.13.7.tgz", "resolved": "https://registry.npmjs.org/@distube/ytdl-core/-/ytdl-core-4.14.4.tgz",
"integrity": "sha512-xpovwZVPwQ0R4Mrwt/fhh1rqmBjiZ5qj30ck5kz+mQJ5XPzW9dUiTDz89qCxO3YvgbCAqaC5BNNnWiFC2uCV5Q==", "integrity": "sha512-dHb4GW3qATIjRsS6VIhm3Pop7FdUcDFhsnyQlsPeXW7UhTPuNS0BmraKiTpFbpp0Ky+rxBQjJBfPRFsM+dT1fg==",
"requires": { "requires": {
"http-cookie-agent": "^6.0.5", "http-cookie-agent": "^6.0.5",
"m3u8stream": "^0.8.6", "m3u8stream": "^0.8.6",
"miniget": "^4.2.3", "miniget": "^4.2.3",
"sax": "^1.4.1", "sax": "^1.4.1",
"tough-cookie": "^4.1.4", "tough-cookie": "^4.1.4",
"undici": "^6.19.2" "undici": "five"
} }
}, },
"@types/node": { "@types/node": {

View file

@ -23,7 +23,7 @@
}, },
"homepage": "https://github.com/Violets-puragtory/YoutubeConverter#readme", "homepage": "https://github.com/Violets-puragtory/YoutubeConverter#readme",
"dependencies": { "dependencies": {
"@distube/ytdl-core": "^4.13.7", "@distube/ytdl-core": "^4.14.4",
"child_process": "^1.0.2", "child_process": "^1.0.2",
"express": "^4.18.2", "express": "^4.18.2",
"ffmpeg-static": "^5.2.0" "ffmpeg-static": "^5.2.0"