diff --git a/.env.example b/.env.example index 0b9efdb..f069167 100644 --- a/.env.example +++ b/.env.example @@ -2,4 +2,4 @@ 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/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 3eb5b52..51f6387 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -29,15 +29,13 @@ jobs: - name: Create Release run: | npm ci - touch .env.production - echo "HOST=0.0.0.0" >> .env.production - echo "PORT=3000" >> .env.production - echo "ORIGIN=https://dl.emersa.it" >> .env.production - echo "PUBLIC_VERSION=$(cat package.json | jq .version)" >> .env.production - echo "NODE_ENV=production" >> .env.production + touch .env + echo "HOST=0.0.0.0" >> .env + echo "ORIGIN=https://dl.emersa.it" >> .env + echo "PUBLIC_VERSION=$(cat package.json | jq .version)" >> .env npm run build cp package* build/ - cp .env.production build/ + cp .env build/ mkdir releases cd build/ tar czvf ../releases/build.tar.gz . diff --git a/package-lock.json b/package-lock.json index 83f47b9..2577770 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,42 +1,42 @@ { "name": "dl.emersa.it", - "version": "1.0.2", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dl.emersa.it", - "version": "1.0.2", + "version": "1.0.0", "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" }, "devDependencies": { "@eslint/compat": "^1.2.8", - "@eslint/js": "^9.25.1", + "@eslint/js": "^9.25.0", "@sveltejs/adapter-node": "^5.2.12", "@sveltejs/kit": "^2.20.7", "@sveltejs/vite-plugin-svelte": "^5.0.3", "@tailwindcss/vite": "^4.1.4", - "eslint": "^9.25.1", + "eslint": "^9.25.0", "eslint-config-prettier": "^10.1.2", "eslint-plugin-svelte": "^3.5.1", "globals": "^16.0.0", - "mdsvex": "^0.12.5", + "mdsvex": "^0.12.3", "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", + "sveltekit-sse": "^0.13.18", "tailwindcss": "^4.1.4", "typescript": "^5.8.3", - "typescript-eslint": "^8.31.0", - "vite": "^6.3.3" + "typescript-eslint": "^8.30.1", + "vite": "^6.3.2" } }, "node_modules/@alloc/quick-lru": { @@ -639,9 +639,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.25.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.1.tgz", - "integrity": "sha512-dEIwmjntEx8u3Uvv+kr3PDeeArL8Hw07H9kyYxCjnM9pBjfEhk6uLXSchxxzgiwtRhhzVzqmUSDFBOi1TuZ7qg==", + "version": "9.25.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.0.tgz", + "integrity": "sha512-iWhsUS8Wgxz9AXNfvfOPFSW4VfMXdVhp1hjkZVhXCrpgh/aLcc45rX6MPu+tIVUWDw0HfNwth7O28M1xDxNf9w==", "dev": true, "license": "MIT", "engines": { @@ -1628,20 +1628,10 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "*" - } - }, "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" @@ -1665,17 +1655,17 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.31.0.tgz", - "integrity": "sha512-evaQJZ/J/S4wisevDvC1KFZkPzRetH8kYZbkgcTRyql3mcKsf+ZFDV1BVWUGTCAW5pQHoqn5gK5b8kn7ou9aFQ==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.30.1.tgz", + "integrity": "sha512-v+VWphxMjn+1t48/jO4t950D6KR8JaJuNXzi33Ve6P8sEmPr5k6CEXjdGwT6+LodVnEa91EQCtwjWNUCPweo+Q==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.31.0", - "@typescript-eslint/type-utils": "8.31.0", - "@typescript-eslint/utils": "8.31.0", - "@typescript-eslint/visitor-keys": "8.31.0", + "@typescript-eslint/scope-manager": "8.30.1", + "@typescript-eslint/type-utils": "8.30.1", + "@typescript-eslint/utils": "8.30.1", + "@typescript-eslint/visitor-keys": "8.30.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1695,16 +1685,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.31.0.tgz", - "integrity": "sha512-67kYYShjBR0jNI5vsf/c3WG4u+zDnCTHTPqVMQguffaWWFs7artgwKmfwdifl+r6XyM5LYLas/dInj2T0SgJyw==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.30.1.tgz", + "integrity": "sha512-H+vqmWwT5xoNrXqWs/fesmssOW70gxFlgcMlYcBaWNPIEWDgLa4W9nkSPmhuOgLnXq9QYgkZ31fhDyLhleCsAg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.31.0", - "@typescript-eslint/types": "8.31.0", - "@typescript-eslint/typescript-estree": "8.31.0", - "@typescript-eslint/visitor-keys": "8.31.0", + "@typescript-eslint/scope-manager": "8.30.1", + "@typescript-eslint/types": "8.30.1", + "@typescript-eslint/typescript-estree": "8.30.1", + "@typescript-eslint/visitor-keys": "8.30.1", "debug": "^4.3.4" }, "engines": { @@ -1720,14 +1710,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.31.0.tgz", - "integrity": "sha512-knO8UyF78Nt8O/B64i7TlGXod69ko7z6vJD9uhSlm0qkAbGeRUSudcm0+K/4CrRjrpiHfBCjMWlc08Vav1xwcw==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.30.1.tgz", + "integrity": "sha512-+C0B6ChFXZkuaNDl73FJxRYT0G7ufVPOSQkqkpM/U198wUwUFOtgo1k/QzFh1KjpBitaK7R1tgjVz6o9HmsRPg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.31.0", - "@typescript-eslint/visitor-keys": "8.31.0" + "@typescript-eslint/types": "8.30.1", + "@typescript-eslint/visitor-keys": "8.30.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1738,14 +1728,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.31.0.tgz", - "integrity": "sha512-DJ1N1GdjI7IS7uRlzJuEDCgDQix3ZVYVtgeWEyhyn4iaoitpMBX6Ndd488mXSx0xah/cONAkEaYyylDyAeHMHg==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.30.1.tgz", + "integrity": "sha512-64uBF76bfQiJyHgZISC7vcNz3adqQKIccVoKubyQcOnNcdJBvYOILV1v22Qhsw3tw3VQu5ll8ND6hycgAR5fEA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.31.0", - "@typescript-eslint/utils": "8.31.0", + "@typescript-eslint/typescript-estree": "8.30.1", + "@typescript-eslint/utils": "8.30.1", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, @@ -1762,9 +1752,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.31.0.tgz", - "integrity": "sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.30.1.tgz", + "integrity": "sha512-81KawPfkuulyWo5QdyG/LOKbspyyiW+p4vpn4bYO7DM/hZImlVnFwrpCTnmNMOt8CvLRr5ojI9nU1Ekpw4RcEw==", "dev": true, "license": "MIT", "engines": { @@ -1776,14 +1766,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.31.0.tgz", - "integrity": "sha512-xLmgn4Yl46xi6aDSZ9KkyfhhtnYI15/CvHbpOy/eR5NWhK/BK8wc709KKwhAR0m4ZKRP7h07bm4BWUYOCuRpQQ==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.30.1.tgz", + "integrity": "sha512-kQQnxymiUy9tTb1F2uep9W6aBiYODgq5EMSk6Nxh4Z+BDUoYUSa029ISs5zTzKBFnexQEh71KqwjKnRz58lusQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.31.0", - "@typescript-eslint/visitor-keys": "8.31.0", + "@typescript-eslint/types": "8.30.1", + "@typescript-eslint/visitor-keys": "8.30.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1829,16 +1819,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.31.0.tgz", - "integrity": "sha512-qi6uPLt9cjTFxAb1zGNgTob4x9ur7xC6mHQJ8GwEzGMGE9tYniublmJaowOJ9V2jUzxrltTPfdG2nKlWsq0+Ww==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.30.1.tgz", + "integrity": "sha512-T/8q4R9En2tcEsWPQgB5BQ0XJVOtfARcUvOa8yJP3fh9M/mXraLxZrkCfGb6ChrO/V3W+Xbd04RacUEqk1CFEQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.31.0", - "@typescript-eslint/types": "8.31.0", - "@typescript-eslint/typescript-estree": "8.31.0" + "@typescript-eslint/scope-manager": "8.30.1", + "@typescript-eslint/types": "8.30.1", + "@typescript-eslint/typescript-estree": "8.30.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1853,13 +1843,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.31.0.tgz", - "integrity": "sha512-QcGHmlRHWOl93o64ZUMNewCdwKGU6WItOU52H0djgNmn1EOrhVudrDzXz4OycCRSCPwFCDrE2iIt5vmuUdHxuQ==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.30.1.tgz", + "integrity": "sha512-aEhgas7aJ6vZnNFC7K4/vMGDGyOiqWcYZPpIWrTKuTAlsvDNKy2GFDqh9smL+iq069ZvR0YzEeq0B8NJlLzjFA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.31.0", + "@typescript-eslint/types": "8.30.1", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -2388,9 +2378,9 @@ } }, "node_modules/eslint": { - "version": "9.25.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.1.tgz", - "integrity": "sha512-E6Mtz9oGQWDCpV12319d59n4tx9zOTXSTmc8BLVxBx+G/0RdM5MvEEJLU9c0+aleoePYYgVTOsRblx433qmhWQ==", + "version": "9.25.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.0.tgz", + "integrity": "sha512-MsBdObhM4cEwkzCiraDv7A6txFXEqtNXOb877TsSp2FCkBNl8JfVQrmiuDqC1IkejT6JLPzYBXx/xAiYhyzgGA==", "dev": true, "license": "MIT", "dependencies": { @@ -2400,7 +2390,7 @@ "@eslint/config-helpers": "^0.2.1", "@eslint/core": "^0.13.0", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.25.1", + "@eslint/js": "9.25.0", "@eslint/plugin-kit": "^0.2.8", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -2718,11 +2708,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,17 +3451,14 @@ } }, "node_modules/mdsvex": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.12.5.tgz", - "integrity": "sha512-JQy8CBbGF1IvpxZTmGJigRiD1s2BKfLKS9xCLPKngjHToY8WMYLZ8WFGRpuR6x4C4bxipSuLm2LctwL2fVXaEQ==", + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.12.3.tgz", + "integrity": "sha512-C/uIJamjNo5PHHnR3JHqsBPoLcfUBpzRmAEB6FLMXI/s7XHOceswjDMKqSPEW2WHmYpKm0taZ3U20GSyhMridA==", "dev": true, - "license": "MIT", "dependencies": { - "@types/mdast": "^4.0.4", "@types/unist": "^2.0.3", "prism-svelte": "^0.4.7", "prismjs": "^1.17.1", - "unist-util-visit": "^2.0.1", "vfile-message": "^2.0.4" }, "peerDependencies": { @@ -4432,9 +4418,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": { @@ -4534,9 +4520,9 @@ } }, "node_modules/sveltekit-sse": { - "version": "0.13.19", - "resolved": "https://registry.npmjs.org/sveltekit-sse/-/sveltekit-sse-0.13.19.tgz", - "integrity": "sha512-0uOiMqRdpjoM2dM/2fyLPUfGdhhOeW9KX4LR03b4K/cYFoZt4RYyOQJrX5RPijPf9sGX2mXkc0GEA2d0l3zifg==", + "version": "0.13.18", + "resolved": "https://registry.npmjs.org/sveltekit-sse/-/sveltekit-sse-0.13.18.tgz", + "integrity": "sha512-DEK2pcnHZsQTezM6Eq4qBUewkp3v1SBpBXX4eNiFZs4cwfGw++lEVAoPoR4I1CmLjfz+RznblvvX/Q0qomj1VA==", "dev": true, "license": "MIT", "peerDependencies": { @@ -4592,13 +4578,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": { @@ -4692,15 +4678,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.31.0.tgz", - "integrity": "sha512-u+93F0sB0An8WEAPtwxVhFby573E8ckdjwUUQUj9QA4v8JAvgtoDdIyYR3XFwFHq2W1KJ1AurwJCO+w+Y1ixyQ==", + "version": "8.30.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.30.1.tgz", + "integrity": "sha512-D7lC0kcehVH7Mb26MRQi64LMyRJsj3dToJxM1+JVTl53DQSV5/7oUGWQLcKl1C1KnoVHxMMU2FNQMffr7F3Row==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.31.0", - "@typescript-eslint/parser": "8.31.0", - "@typescript-eslint/utils": "8.31.0" + "@typescript-eslint/eslint-plugin": "8.30.1", + "@typescript-eslint/parser": "8.30.1", + "@typescript-eslint/utils": "8.30.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4720,17 +4706,6 @@ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "license": "MIT" }, - "node_modules/unist-util-is": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", - "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", - "dev": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/unist-util-stringify-position": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", @@ -4744,37 +4719,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/unist-util-visit": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", - "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0", - "unist-util-visit-parents": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-parents": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", - "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -4805,18 +4749,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..9c478d5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dl.emersa.it", "private": true, - "version": "1.0.2", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite dev", @@ -16,32 +16,32 @@ }, "devDependencies": { "@eslint/compat": "^1.2.8", - "@eslint/js": "^9.25.1", + "@eslint/js": "^9.25.0", "@sveltejs/adapter-node": "^5.2.12", "@sveltejs/kit": "^2.20.7", "@sveltejs/vite-plugin-svelte": "^5.0.3", "@tailwindcss/vite": "^4.1.4", - "eslint": "^9.25.1", + "eslint": "^9.25.0", "eslint-config-prettier": "^10.1.2", "eslint-plugin-svelte": "^3.5.1", "globals": "^16.0.0", - "mdsvex": "^0.12.5", + "mdsvex": "^0.12.3", "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", + "sveltekit-sse": "^0.13.18", "tailwindcss": "^4.1.4", "typescript": "^5.8.3", - "typescript-eslint": "^8.31.0", - "vite": "^6.3.3" + "typescript-eslint": "^8.30.1", + "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/install.sh b/scripts/install.sh index 929c279..57b2ff4 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -29,5 +29,5 @@ tar -xvf build.tar.gz -C . rm build.tar.gz npm ci npm run download-yt-dlp -echo "YTDLP_PATH=$(readlink -f yt-dlp)" >> .env.production -echo "HTTPS_PROXY=${PROXY}" >> .env.production +echo "YTDLP_PATH=$(readlink -f yt-dlp)" >>.env +echo "HTTPS_PROXY=${PROXY}" >>.env 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/client/downloader.ts b/src/lib/client/downloader.ts new file mode 100644 index 0000000..c75c651 --- /dev/null +++ b/src/lib/client/downloader.ts @@ -0,0 +1,21 @@ +const createAnchorElement = (url: string, filename: string): HTMLAnchorElement => { + const anchor = document.createElement('a'); + anchor.href = url; + anchor.download = filename; + return anchor; +}; +export const download = async (url: string, filename: string) => { + const response = await fetch(url); + + if (!response.ok) { + throw new Error('Network response was not ok'); + } + + const blob = await response.blob(); + const objectURL = window.URL.createObjectURL(blob); + const anchor = createAnchorElement(url, filename); + document.body.appendChild(anchor); + anchor.click(); + anchor.remove(); + window.URL.revokeObjectURL(objectURL); +}; diff --git a/src/lib/components/DownloadManager.svelte b/src/lib/components/DownloadManager.svelte new file mode 100644 index 0000000..efe3bc0 --- /dev/null +++ b/src/lib/components/DownloadManager.svelte @@ -0,0 +1,73 @@ + + +{#if visible} +
+
+

+ Downloading {filename} +

+
+
+
+

{progress}%

+
+
+{/if} 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/components/ProgressBar.svelte b/src/lib/components/ProgressBar.svelte deleted file mode 100644 index 04bb07d..0000000 --- a/src/lib/components/ProgressBar.svelte +++ /dev/null @@ -1,22 +0,0 @@ - - -
-
-

- Downloading {filename} -

-
-
-
-

{progress}%

-
-
diff --git a/src/lib/server/helpers.ts b/src/lib/server/helpers.ts index 1b86056..4b42bbb 100644 --- a/src/lib/server/helpers.ts +++ b/src/lib/server/helpers.ts @@ -1,8 +1,9 @@ import formats from '$lib/common/supportedFormats.json'; import winston from 'winston'; +import { dev } from '$app/environment'; export const logger = winston.createLogger({ - level: 'debug', + level: dev ? 'debug' : 'error', format: winston.format.json(), transports: [new winston.transports.Console()] }); 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..eb2fc45 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,17 +1,20 @@