From b027a2aa0fa623d7b278558bdf57b29b3a42fbc9 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 18 Sep 2021 08:34:33 +0200 Subject: [PATCH] web-services/youtube: Add converting takeout playlist to invidious --- docs/web-services.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/web-services.md b/docs/web-services.md index 74d020f..fbef1ee 100644 --- a/docs/web-services.md +++ b/docs/web-services.md @@ -40,3 +40,14 @@ :::js console.log(JSON.stringify(Array.from(document.querySelectorAll('#js-achievements table tbody tr')).map(row => { const cols = row.querySelectorAll('td'); return { name: cols[0].innerText, description: cols[1].querySelector('p.i').innerText, displayName: cols[1].childNodes[0].textContent.replace(/\n/g, ''), hidden: "0", icon: "achievements/" + cols[0].innerText + ".jpg", icongray: "achievements/" + cols[0].innerText + "_gray.jpg" } }))) + +## YouTube + +### Convert takeout playlists to Invidious format + +Incredibly ugly, but it works™. + +If you want the import to succeed remove the liked video playlist before importing. + + :::shell + (echo '{"playlists":['; (for i in *.csv; do echo '{"title": "'"${i%%.csv}"'", "description": "", "privacy": "private", "videos": ["'"$(tail -n +5 "$i" | head -n -1 | cut -d',' -f1| perl -p -e 's/\n/","/' | head -c -3)"'"]},'; done)|head -c -2; echo ']}') > playlists.json