Skip to content

Instantly share code, notes, and snippets.

@juzam
Last active August 27, 2018 00:23
Show Gist options
  • Save juzam/8004696 to your computer and use it in GitHub Desktop.
Save juzam/8004696 to your computer and use it in GitHub Desktop.
huffduffer automator
#!/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