Features: - New GET /public/download/:filename endpoint for public file access - No authentication required for downloading processed files - Directory traversal protection with path.basename() - Proper Content-Disposition headers for browser downloads Documentation: - Updated docs/API.md with public endpoint section - Added to table of contents - Usage examples and security notes Use cases: - Share download links via email/chat/social media - Embed in web applications without auth - Direct browser downloads - Public file sharing Security: - Path sanitization prevents directory traversal attacks - Only files in OUTPUT_DIR are accessible - Returns proper 404 for non-existent files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
15 lines
522 B
Bash
Executable File
15 lines
522 B
Bash
Executable File
#!/bin/bash
|
|
# Auto-refresh cookies from /tmp/share if they exist and are newer
|
|
|
|
SHARE_COOKIES="/tmp/share/youtube-cookies.txt"
|
|
LOCAL_COOKIES="/home/debian/videotomp3transcriptor/youtube-cookies.txt"
|
|
|
|
if [ -f "$SHARE_COOKIES" ]; then
|
|
# Copy if share is newer or local doesn't exist
|
|
if [ ! -f "$LOCAL_COOKIES" ] || [ "$SHARE_COOKIES" -nt "$LOCAL_COOKIES" ]; then
|
|
cp "$SHARE_COOKIES" "$LOCAL_COOKIES"
|
|
chmod 600 "$LOCAL_COOKIES"
|
|
echo "[$(date)] ✓ Cookies refreshed from /tmp/share"
|
|
fi
|
|
fi
|