diff --git a/.DS_Store b/.DS_Store index 874ae75..e3e23f1 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/index.js b/index.js index 703763f..1bd8990 100644 --- a/index.js +++ b/index.js @@ -186,8 +186,9 @@ app.ws('/download/:id/:quality', async (ws, req) => { ws.send('Downloaded video and audio. Merging them together.') await mergeIt(`./output/${req.params.id}_audio.mp4`, `./output/${req.params.id}_video.mp4`, `./output/${req.params.id}.mp4`) - fs.rmSync(`./output/${req.params.id}_audio.mp4`) - fs.rmSync(`./output/${req.params.id}_video.mp4`) + + if (fs.existsSync(`./output/${req.params.id}_audio.mp4`)) fs.rmSync(`./output/${req.params.id}_audio.mp4`) + if (fs.existsSync(`./output/${req.params.id}_video.mp4`)) fs.rmSync(`./output/${req.params.id}_video.mp4`) ws.send('done') ws.close() diff --git a/package.json b/package.json index 0fd9a71..3807d9b 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,6 @@ "express-ws": "^5.0.2", "ffmpeg-static": "^5.2.0", "fluent-ffmpeg": "^2.1.3", - "youtubei.js": "^11.0.1" + "youtubei.js": "^12.2.0" } } diff --git a/yarn.lock b/yarn.lock index e756dab..c833a03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -393,10 +393,10 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -jintr@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/jintr/-/jintr-3.0.2.tgz#633ecc8da930d25f5004697acb5af4ff36628f26" - integrity sha512-5g2EBudeJFOopjAX4exAv5OCCW1DgUISfoioCsm1h9Q9HJ41LmnZ6J52PCsqBlQihsmp0VDuxreAVzM7yk5nFA== +jintr@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jintr/-/jintr-3.2.0.tgz#38bfc2311c7ed4412ebe0bfc5c2e700f8f433921" + integrity sha512-psD1yf05kMKDNsUdW1l5YhO59pHScQ6OIHHb8W5SKSM2dCOFPsqolmIuSHgVA8+3Dc47NJR181CXZ4alCAPTkA== dependencies: acorn "^8.8.0" @@ -663,12 +663,12 @@ ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== -youtubei.js@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-11.0.1.tgz#5729bbf2df8dff58c3555140d23ae83c458f0b34" - integrity sha512-ZsbOd+5XF2Ofi3FrLMfYd+f9g9H8xswlouFhjhOqbwT68dMJtX6CRGsHNj5VTFCR/+L/865x1lnUlllB2dDDTA== +youtubei.js@^12.2.0: + version "12.2.0" + resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-12.2.0.tgz#54f058b5d0892b5c7e35019e2be6a2a7f7ba4447" + integrity sha512-G+50qrbJCToMYhu8jbaHiS3Vf+RRul+CcDbz3hEGwHkGPh+zLiWwD6SS+YhYF+2/op4ZU5zDYQJrGqJ+wKh7Gw== dependencies: "@bufbuild/protobuf" "^2.0.0" - jintr "^3.0.2" + jintr "^3.2.0" tslib "^2.5.0" undici "^5.19.1"