-
-
Save faun/9501666 to your computer and use it in GitHub Desktop.
Download videos from youtube and add them to iTunes
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/sh | |
# Usage: steal <YOUTUBE-URL> | |
# Requirements: youtube-dl, ffmpeg | |
set -e | |
# strip the YouTube playlist | |
url="${1%%&*}" | |
if [ -z "$url" ]; then | |
echo "no URL given" >&2 | |
exit 1 | |
fi | |
youtube-dl -f mp4/webm --no-mtime -o '/tmp/%(title)s.%(ext)s' "$url" | |
shopt -s nullglob | |
mv "$(ls -t /tmp/*.{m4a,mp3,mp4} | head -1)" \ | |
"$HOME/Music/iTunes/iTunes Media/Automatically Add to iTunes/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment