local a='chi.halfmoon-vibe.ts.net'local function b(c)local d,e=http.get('http://'..a..c,nil,true)if not d then error(e)end;local f=d.readAll()d.close()return f end;local g=textutils.unserializeJSON(b('/info'))local h,i={},{}local j=peripheral.find'speaker'term.clear()local k=2;parallel.waitForAll(function()for l=0,g.length-1 do h[l]=b('/video/'..l)if k>0 then k=k-1 end end end,function()pcall(function()for l=0,g.length/g.fps do i[l]=b('/audio/'..l)if k>0 then k=k-1 end end end)end,function()while k>0 do os.pullEvent()end;local m=os.epoch'utc'for l=0,g.length-1 do while not h[l]do os.pullEvent()end;local n=h[l]h[l]=nil;local o,p=assert(load(n,'=frame','t',{}))()for q=0,#p do term.setPaletteColor(2^q,table.unpack(p[q]))end;for r,s in ipairs(o)do term.setCursorPos(1,r)term.blit(table.unpack(s))end;while os.epoch'utc'<m+(l+1)/g.fps*1000 do sleep(1/g.fps)end end end,function()if not j or not j.playAudio then return end;while k>0 do os.pullEvent()end;local t=0;while t<g.length/g.fps do while not i[t]do os.pullEvent()end;local u=i[t]i[t]=nil;u={u:byte(1,-1)}for q=1,#u do u[q]=u[q]-128 end;t=t+1;if not j.playAudio(u)then repeat local v,w=os.pullEvent('speaker_audio_empty')until w==peripheral.getName(j)end end end)for q=0,15 do term.setPaletteColor(2^q,term.nativePaletteColor(2^q))end;term.setBackgroundColor(colors.black)term.setTextColor(colors.white)term.setCursorPos(1,1)term.clear()