Last active
August 27, 2018 00:23
-
-
Save juzam/8004696 to your computer and use it in GitHub Desktop.
huffduffer automator
This file contains hidden or 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
#!/bin/bash | |
URL=$1 | |
WORKDIR=/tmp | |
# puff.py helper location | |
PUFF=/usr/local/bin/puff.py | |
ID=`youtube-dl --get-id $URL` | |
TITLE=`youtube-dl --get-title $URL` | |
DESCRIPTION=`youtube-dl --get-description $URL` | |
# this is where the final uploaded mp3 will be available | |
HUFFURL="http://somewhere/$ID.mp3" | |
cd $WORKDIR | |
# download it | |
youtube-dl -x --audio-format mp3 -o "%(id)s.%(ext)s" $URL | |
# upload it somewhere | |
# huffduff it with puff.py helper (https://github.com/juzam/Puff) | |
cd - | |
$PUFF "$HUFFURL" "$TITLE" "$DESCRIPTION" | |
rm $WORKDIR/$ID.mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment