Last active
September 24, 2020 20:30
-
-
Save pboos/5063551 to your computer and use it in GitHub Desktop.
Extract the playlists of plug.dj
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
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)); | |
} | |
} |
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
#!/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