├── .gitignore ├── README.md └── youtube-dl.lua /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Lua sources 2 | luac.out 3 | 4 | # luarocks build files 5 | *.src.rock 6 | *.zip 7 | *.tar.gz 8 | 9 | # Object files 10 | *.o 11 | *.os 12 | *.ko 13 | *.obj 14 | *.elf 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | *.def 26 | *.exp 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vlc-youtubeDL 2 | A vlc addon for [youtube-dl](http://ytdl-org.github.io/youtube-dl/) integration. 3 | 4 | ### Prerequisites 5 | - A working `youtube-dl` installation (`youtube-dl` must be in `$PATH`) 6 | 7 | ### Installation 8 | Put [`youtube-dl.lua`](https://github.com/mjasny/vlc-youtubeDL/blob/master/youtube-dl.lua) into: 9 | - In Windows: `%APPDATA%\vlc\lua\playlist\` 10 | - In Mac OS X: `/Users/%your_name%/Library/Application Support/org.videolan.vlc/lua/playlist/` 11 | - In Linux: `~/.local/share/vlc/lua/playlist/` 12 | 13 | ### Usage 14 | Simply open a YouTube link in VLC. 15 | 16 | For those who had issue with the addon, you might want to [check this out too.](https://github.com/mjasny/vlc-youtubeDL/issues/3) 17 | -------------------------------------------------------------------------------- /youtube-dl.lua: -------------------------------------------------------------------------------- 1 | -- If you experience some problems with with the old buggy dkjson version, like in issue #3 2 | -- You need to download the latest version of dkjson until https://code.videolan.org/videolan/vlc/-/merge_requests/3318 is merged. 3 | 4 | JSON = require "dkjson" -- load additional json routines 5 | 6 | -- Probe function. 7 | function probe() 8 | if vlc.access == "http" or vlc.access == "https" then 9 | peeklen = 9 10 | s = "" 11 | while string.len(s) < 9 do 12 | s = string.lower(string.gsub(vlc.peek(peeklen), "%s", "")) 13 | peeklen = peeklen + 1 14 | end 15 | return s == "