just log everything sadly

This commit is contained in:
0d0 2025-04-19 18:50:10 +02:00
parent e3c0c7d1f9
commit 716ebe9ecd
4 changed files with 13 additions and 10 deletions

View file

@ -29,14 +29,15 @@ jobs:
- name: Create Release - name: Create Release
run: | run: |
npm ci npm ci
touch .env touch .env.production
echo "HOST=0.0.0.0" >> .env echo "HOST=0.0.0.0" >> .env.production
echo "ORIGIN=https://dl.emersa.it" >> .env echo "PORT=3000" >> .env.production
echo "PUBLIC_VERSION=$(cat package.json | jq .version)" >> .env echo "ORIGIN=https://dl.emersa.it" >> .env.production
echo "NODE_ENV=production" >> .env echo "PUBLIC_VERSION=$(cat package.json | jq .version)" >> .env.production
echo "NODE_ENV=production" >> .env.production
npm run build npm run build
cp package* build/ cp package* build/
cp .env build/ cp .env.production build/
mkdir releases mkdir releases
cd build/ cd build/
tar czvf ../releases/build.tar.gz . tar czvf ../releases/build.tar.gz .

View file

@ -29,5 +29,5 @@ tar -xvf build.tar.gz -C .
rm build.tar.gz rm build.tar.gz
npm ci npm ci
npm run download-yt-dlp npm run download-yt-dlp
echo "YTDLP_PATH=$(readlink -f yt-dlp)" >>.env echo "YTDLP_PATH=$(readlink -f yt-dlp)" >> .env.production
echo "HTTPS_PROXY=${PROXY}" >>.env echo "HTTPS_PROXY=${PROXY}" >> .env.production

View file

@ -1,12 +1,12 @@
import formats from '$lib/common/supportedFormats.json'; import formats from '$lib/common/supportedFormats.json';
import winston from 'winston'; import winston from 'winston';
import { dev } from '$app/environment';
export const logger = winston.createLogger({ export const logger = winston.createLogger({
level: import.meta.env.DEV ? 'debug' : 'error', level: 'debug',
format: winston.format.json(), format: winston.format.json(),
transports: [new winston.transports.Console()] transports: [new winston.transports.Console()]
}); });
logger.debug(import.meta.env.DEV)
const formatMime = new Map(Object.entries(formats)); const formatMime = new Map(Object.entries(formats));
export const isURLValid = (url: string) => { export const isURLValid = (url: string) => {
try { try {

View file

@ -41,6 +41,8 @@ export const GET: RequestHandler = async ({ url }) => {
let filename = ''; let filename = '';
let contentLength = 0; let contentLength = 0;
logger.debug(`Requested: ${link}`);
try { try {
logger.debug(`Fetching video data to set filename`); logger.debug(`Fetching video data to set filename`);
// Fetch metadata for filename // Fetch metadata for filename