ytdlp-ffmpeg.uniqueweb.site
Convert YouTube video to a JSON dictionary of ANSI frames for OpenComputers.
API
GET http://ytdlp-ffmpeg.uniqueweb.site/api?=<youtube_url>
GET http://ytdlp-ffmpeg.uniqueweb.site/api?url=<youtube_url>
[&seconds=30][&fps=10][&width=80][&height=25][&colors=256]
Returns: application/json
Body: { "1": "<ansi frame>", "2": "...", ... }
Headers: X-Frame-Count, X-Fps, X-Width, X-Height, X-Colors, X-Title
Limits: seconds <= 600, fps <= 30, size <= 200x100
Colors: 2, 8, 16, 240, 256, or 16777215 (truecolor)
From OpenComputers Lua (using a JSON lib like dkjson or rapidjson):
local internet = require("internet")
local json = require("json") -- e.g. dkjson
local buf = ""
for chunk in internet.request(
"http://ytdlp-ffmpeg.uniqueweb.site/api?url=" ..
"https%3A%2F%2Fyoutu.be%2FdQw4w9WgXcQ&seconds=10"
) do buf = buf .. chunk end
local frames = json.decode(buf)
for i = 1, #frames do
io.write(frames[tostring(i)])
os.sleep(1/10) -- match the fps
end