diff --git a/.env.example b/.env.example index 0b9efdb..b7f7612 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ +NODE_ENV=development HOST=0.0.0.0 ORIGIN=https://dl.emersa.it YTDLP_PATH=./yt-dlp PUBLIC_VERSION=0.6.3 -HTTPS_PROXY= +HTTPS_PROXY= \ No newline at end of file diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 9ff6b3c..9d5a98e 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Just some continuos integration +name: Bump deps (only minor versions) on: [push] @@ -15,16 +15,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: '20' - - name: Format things if needed + - name: Prepare, Check, Lint and Format run: | - npm install + npm i npm run prepare - npm run lint - npm run format - git config --global user.name "forgejo-bot" - git config --global user.email "bot@pweapon.org" - git add --all || exit 0 - git commit -m "chore: lint and format" || exit 0 - git push origin HEAD:${GITHUB_REF#refs/heads/} - env: - GITHUB_TOKEN: ${{ secrets.FORGEJO_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 83f47b9..b4f54a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "dl.emersa.it", - "version": "1.0.2", + "version": "1.0.1-b", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dl.emersa.it", - "version": "1.0.2", + "version": "1.0.1-b", "dependencies": { "@tailwindcss/forms": "^0.5.10", "@tailwindcss/postcss": "^4.1.4", "@tailwindcss/typography": "^0.5.16", - "@types/node": "^22.15.2", + "@types/node": "^22.14.1", "winston": "^3.17.0", "youtube-dl-exec": "^3.0.20" }, @@ -26,17 +26,17 @@ "eslint-config-prettier": "^10.1.2", "eslint-plugin-svelte": "^3.5.1", "globals": "^16.0.0", - "mdsvex": "^0.12.5", + "mdsvex": "^0.12.4", "prettier": "^3.5.3", "prettier-plugin-svelte": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.11", - "svelte": "^5.28.2", + "svelte": "^5.28.1", "svelte-check": "^4.1.6", "sveltekit-sse": "^0.13.19", "tailwindcss": "^4.1.4", "typescript": "^5.8.3", "typescript-eslint": "^8.31.0", - "vite": "^6.3.3" + "vite": "^6.3.2" } }, "node_modules/@alloc/quick-lru": { @@ -1639,9 +1639,9 @@ } }, "node_modules/@types/node": { - "version": "22.15.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.2.tgz", - "integrity": "sha512-uKXqKN9beGoMdBfcaTY1ecwz6ctxuJAcUlwE55938g0ZJ8lRxwAZqRz2AJ4pzpt5dHdTPMB863UZ0ESiFUcP7A==", + "version": "22.14.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.1.tgz", + "integrity": "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==", "license": "MIT", "dependencies": { "undici-types": "~6.21.0" @@ -2718,11 +2718,10 @@ } }, "node_modules/fdir": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", - "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", "dev": true, - "license": "MIT", "peerDependencies": { "picomatch": "^3 || ^4" }, @@ -3462,9 +3461,9 @@ } }, "node_modules/mdsvex": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.12.5.tgz", - "integrity": "sha512-JQy8CBbGF1IvpxZTmGJigRiD1s2BKfLKS9xCLPKngjHToY8WMYLZ8WFGRpuR6x4C4bxipSuLm2LctwL2fVXaEQ==", + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.12.4.tgz", + "integrity": "sha512-m7m2VN7gKl9OAwRbUju6EDH1zzQf9tU5jFFEAEW13am2GuGstNYyYEY35J0vmCSviC5xgwsnQGYoCg+lYMxKRQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4432,9 +4431,9 @@ } }, "node_modules/svelte": { - "version": "5.28.2", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.28.2.tgz", - "integrity": "sha512-FbWBxgWOpQfhKvoGJv/TFwzqb4EhJbwCD17dB0tEpQiw1XyUEKZJtgm4nA4xq3LLsMo7hu5UY/BOFmroAxKTMg==", + "version": "5.28.1", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.28.1.tgz", + "integrity": "sha512-iOa9WmfNG95lSOSJdMhdjJ4Afok7IRAQYXpbnxhd5EINnXseG0GVa9j6WPght4eX78XfFez45Fi+uRglGKPV/Q==", "dev": true, "license": "MIT", "dependencies": { @@ -4592,13 +4591,13 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", - "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", "dev": true, "license": "MIT", "dependencies": { - "fdir": "^6.4.4", + "fdir": "^6.4.3", "picomatch": "^4.0.2" }, "engines": { @@ -4805,18 +4804,18 @@ } }, "node_modules/vite": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.3.tgz", - "integrity": "sha512-5nXH+QsELbFKhsEfWLkHrvgRpTdGJzqOZ+utSdmPTvwHmvU6ITTm3xx+mRusihkcI8GeC7lCDyn3kDtiki9scw==", + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.2.tgz", + "integrity": "sha512-ZSvGOXKGceizRQIZSz7TGJ0pS3QLlVY/9hwxVh17W3re67je1RKYzFHivZ/t0tubU78Vkyb9WnHPENSBCzbckg==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", - "fdir": "^6.4.4", + "fdir": "^6.4.3", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", - "tinyglobby": "^0.2.13" + "tinyglobby": "^0.2.12" }, "bin": { "vite": "bin/vite.js" diff --git a/package.json b/package.json index 5e3cd9e..5467659 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dl.emersa.it", "private": true, - "version": "1.0.2", + "version": "1.0.1-b", "type": "module", "scripts": { "dev": "vite dev", @@ -25,23 +25,23 @@ "eslint-config-prettier": "^10.1.2", "eslint-plugin-svelte": "^3.5.1", "globals": "^16.0.0", - "mdsvex": "^0.12.5", + "mdsvex": "^0.12.4", "prettier": "^3.5.3", "prettier-plugin-svelte": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.11", - "svelte": "^5.28.2", + "svelte": "^5.28.1", "svelte-check": "^4.1.6", "sveltekit-sse": "^0.13.19", "tailwindcss": "^4.1.4", "typescript": "^5.8.3", "typescript-eslint": "^8.31.0", - "vite": "^6.3.3" + "vite": "^6.3.2" }, "dependencies": { "@tailwindcss/forms": "^0.5.10", "@tailwindcss/postcss": "^4.1.4", "@tailwindcss/typography": "^0.5.16", - "@types/node": "^22.15.2", + "@types/node": "^22.14.1", "winston": "^3.17.0", "youtube-dl-exec": "^3.0.20" } diff --git a/scripts/release.sh b/scripts/release.sh index 53df3fc..047e23e 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -14,5 +14,4 @@ __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" version="${1:?Error: No argument provided. Usage: $0 }" npm version "v${version}" -git push --tags -git push \ No newline at end of file +git push --tags \ No newline at end of file diff --git a/src/lib/components/ProgressBar.svelte b/src/lib/components/DownloadManager.svelte similarity index 98% rename from src/lib/components/ProgressBar.svelte rename to src/lib/components/DownloadManager.svelte index 04bb07d..ffa1444 100644 --- a/src/lib/components/ProgressBar.svelte +++ b/src/lib/components/DownloadManager.svelte @@ -15,7 +15,7 @@
+ />

{progress}%

diff --git a/src/lib/components/Loader.svelte b/src/lib/components/Loader.svelte new file mode 100644 index 0000000..4ea9b50 --- /dev/null +++ b/src/lib/components/Loader.svelte @@ -0,0 +1,28 @@ +
+ +
diff --git a/src/lib/server/ytdlp.ts b/src/lib/server/ytdlp.ts index 1a548ed..173c9bf 100644 --- a/src/lib/server/ytdlp.ts +++ b/src/lib/server/ytdlp.ts @@ -1,6 +1,7 @@ -import { create, type Flags } from 'youtube-dl-exec'; +import { create } from 'youtube-dl-exec'; import { env } from '$env/dynamic/private'; import { spawn } from 'node:child_process'; +import supportedFormats from '$lib/common/supportedFormats.json'; import { logger, mimeTypeMap } from '$lib/server/helpers'; const YTDLP_PATH: string = env.YTDLP_PATH as string; @@ -12,7 +13,7 @@ export const ytdl = create(YTDLP_PATH); * Fetch YouTube metadata (title, uploader/artist) */ export async function getYouTubeMetadata(link: string) { - const options: Flags = { + const options = { dumpSingleJson: true, noCheckCertificates: true, noWarnings: true, @@ -65,11 +66,10 @@ export function streamYouTube(link: string, format: string): ReadableStream { try { controller.enqueue(chunk); - } catch { + } catch (ex) { process.kill(); } }); - process.stderr.on('data', (chunk) => logger.debug(chunk.toString())); process.stdout.on('end', () => { try { diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 600806b..f23038c 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,7 +1,9 @@