February 24, 2021 · 2 min read
I came across this Lua script which parses Youtube playlist links and adds them to a VLC playlist. It seems to work only on Windows though so I made a few tweaks to make it run on Linux.
Some context
Youtube has loads of amazing channels for learning, and I like to
bingewatch tutorials and courses at ~3x speed.
I use uBlock Origin on Firefox, it efficiently eliminates the the
primary hurdle to bingewatching, ads.
However, learning from Youtube has a significant risk.
It is distracting.
I’ll admit that damned sidebar of recommendations has lead me astray on several occasions, I found myself looking at questionable videos at odd times instead of pending Watch Later videos I have piled up.
Sure, browser extensions exist for this purpose, but I wanted to play
with VLC addon scripts.
I’m very happy with the results π€©
Script
Installation
On Linux:
Save the script in ~/.local/share/vlc/lua/playlist/
along with
JSON.lua and the youtube-dl
binary for Linux.
The folder structure should look like this:
~/.local/share/vlc/lua/playlist
βββ JSON.lua
βββ youtube-dl
βββ yt-playlist.lua
On Windows:
Save
this
script in %APPDATA%\vlc\lua\playlist\
along with
JSON.lua and the youtube-dl
binary for Windows.
The folder structure should look like this:
C:\USERS\<username>\APPDATA\ROAMING\VLC
ββββlua
ββββplaylist
ββββJSON.lua
ββββyoutube-dl.exe
ββββyt-playlist.lua
Usage
After installation, relaunch VLC and open the Open Media
> Network
menu (C-n), and enter the Youtube playlist URL.
It will be parsed automatically and added to the current playlist. You
can save the playlist as a .xspf
file and share it as well!