Skip to content

Instantly share code, notes, and snippets.

@pboos
Last active September 24, 2020 20:30
Show Gist options
  • Save pboos/5063551 to your computer and use it in GitHub Desktop.
Save pboos/5063551 to your computer and use it in GitHub Desktop.
Extract the playlists of plug.dj
var playlists = JSON.parse(localStorage.getItem("playlist"));
for (var key in playlists) {
var playlist = playlists[key];
console.log(playlist.name);
for (var index in playlist.items) {
console.log("http://www.youtube.com/watch?v=" + playlist.items[index].substr(2));
}
}
#!/bin/bash
if [ "$1" = "" ]; then
echo "Usage: ./script file.txt"
fi
index=0
while read line ; do
LINKS[$index]="$line"
index=$(($index+1))
done < $1
for address in "${LINKS[@]}"
do
video_title="$(youtube-dl --get-title $address)" &>/dev/null
echo "Downloading $video_title"
filename=`youtube-dl --get-filename $address` &>/dev/null
ext=${filename##*.}
youtube-dl $address &>/dev/null
echo "Making into mp3..."
ffmpeg -i $filename "$video_title.wav" &>/dev/null
lame "$video_title.wav" "$video_title.mp3" &>/dev/null
rm "$filename" "$video_title.wav"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment