Commit 1a8f504a authored by 98WuG's avatar 98WuG
Browse files

rudimentary working status

parent 3e4a06c4
*.swp
downloads/*
ydl.log
......@@ -2,4 +2,10 @@
A "nice-looking" open-source YouTube downloader, powered by `youtube-dl`.
Current status: Not functional.
Current status: Working
To-do:
* Catch unsupported URLs
* Rudimentary loading status
* Live loading status
* Auto-setup (cronjob, facl's)
#!/bin/sh
DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)"
DOWNLOAD_FOLDER="downloads"
DOWNLOAD_URL="$DOWNLOAD_FOLDER/$(pwgen)"
DOWNLOAD_URL="$DOWNLOAD_FOLDER/$(pwgen).mp4"
LOG="ydl.log"
echo "Shell script received \"$@\""
mkdir -p "$DOWNLOAD_FOLDER"
echo "Shell script received \"$@\"" >> $DIR/$LOG
mkdir -p "$DIR/$DOWNLOAD_FOLDER" >> $DIR/$LOG
setfacl -m u:apache:rwx "$DIR/$DOWNLOAD_FOLDER" >> $DIR/$LOG
OUTPUT="$(youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' -o "$DIR/$DOWNLOAD_URL" "$@")"
echo "$OUTPUT" >> $DIR/$LOG
echo "$@" > "$DOWNLOAD_URL"
echo "<br><a href=\"./$DOWNLOAD_URL\">Download</a>"
echo "<br><a href=\"./$DOWNLOAD_URL\" download>Download</a>"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment