Skip to content

Instantly share code, notes, and snippets.

@TheYkk

TheYkk/download.sh

Last active Sep 15, 2020
Embed
What would you like to do?
Download private youtube list as mp3

Download js list

First go to your private youtube list (ex. liked videos) , open chrome developer console (right click insepct) paste list.js contex . Its download 2file.json

Download mp3

execute download.sh with same path as 2file.json

while IFS= read -r config; do
a=($(echo $config | tr '=' "\n"))
if ls *$a[2]* 1> /dev/null 2>&1; then
echo "files do exist"
else
youtube-dl -x --audio-format mp3 $config
fi
done< <(jq -c -r '.[]' < 32file.json)
var elem = document.querySelectorAll('a.yt-simple-endpoint.style-scope.ytd-playlist-video-renderer');
var list = [];
elem.forEach(e=>{
list = list.concat(e.href)
})
function downloadObjectAsJson(exportObj, exportName){
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(exportObj));
var downloadAnchorNode = document.createElement('a');
downloadAnchorNode.setAttribute("href", dataStr);
downloadAnchorNode.setAttribute("download", exportName + ".json");
document.body.appendChild(downloadAnchorNode); // required for firefox
downloadAnchorNode.click();
downloadAnchorNode.remove();
}
downloadObjectAsJson(list,"2file")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.