Last active
December 25, 2015 02:59
-
-
Save psamim/6906099 to your computer and use it in GitHub Desktop.
Download Leecher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
[email protected] | |
DIR="files" | |
# SSH To Server | |
ssh $SSH_ACCOUNT 'bash -s'<<ENDSSH | |
# Get File Name | |
filename=\`date +%s\` | |
# Get File | |
wget -P "\$OPENSHIFT_HOMEDIR/app-root/runtime/repo/diy/$DIR/" -O "\$OPENSHIFT_HOMEDIR/app-root/runtime/repo/diy/$DIR/\$filename" $1 | |
# Gives Full URL | |
echo "http://\$OPENSHIFT_APP_DNS/$DIR/\$filename" | |
ENDSSH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
[email protected] | |
YD_DIR="app-root/data" | |
DIR="video" | |
if [ "$1" == "install" ] | |
then | |
# SSH To Server | |
ssh $SSH_ACCOUNT 'bash -s'<<<" | |
wget https://yt-dl.org/downloads/2013.10.07/youtube-dl -O \$OPENSHIFT_HOMEDIR/$YD_DIR/youtube-dl --no-check-certificate | |
chmod +x \$OPENSHIFT_HOMEDIR/$YD_DIR/youtube-dl | |
" | |
exit | |
fi | |
# SSH To Server | |
ssh $SSH_ACCOUNT 'bash -s'<<ENDSSH | |
# Get File Name | |
filename=\`"\$OPENSHIFT_HOMEDIR/$YD_DIR/youtube-dl" --get-filename \ | |
-o "\$OPENSHIFT_HOMEDIR/app-root/runtime/repo/diy/%(id)s.%(ext)s" $1\` | |
# Get Video | |
"\$OPENSHIFT_HOMEDIR/$YD_DIR/youtube-dl" \ | |
-o "\$OPENSHIFT_HOMEDIR/app-root/runtime/repo/diy/$DIR/%(id)s.%(ext)s" $1 | |
# Gives Full URL | |
echo "http://\$OPENSHIFT_APP_DNS/$DIR/\$(basename "\$filename")" | |
ENDSSH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
youtube-dl
Usage
Download video to server, give the direct URL, pipe it.
Get formats
Install
Install DIY cartridge on Openshift, change first line of script, then install youtube-dl on server by running
wget
Usage
Download file to server, give the direct URL, pipe it.