diff --git a/play.lua b/play.lua index cb26d59..6d2efd1 100644 --- a/play.lua +++ b/play.lua @@ -1,15 +1,23 @@ -- 简化版视频播放器 local gpu = peripheral.wrap("tm_gpu_0") +if not gpu then gpu = peripheral.find("tm_gpu") end gpu.refreshSize() gpu.setSize(64) local w, h = gpu.getSize() +local mypath = "/"..fs.getDir(shell.getRunningProgram()) +if not fs.exists(mypath.."/speakerlib.lua") then shell.run("wget https://git.liulikeji.cn/xingluo/computer_craft_video_play/raw/branch/main/speakerlib.lua") end -if not fs.exists("speakerlib.lua") then shell.run("wget https://git.liulikeji.cn/xingluo/computer_craft_video_play/raw/branch/main/speakerlib.lua") end - -server_url = "https://newgmapi.liulikeji.cn" +local server_url = "https://newgmapi.liulikeji.cn" -- 检查命令行参数 -local videoUrl = ... +local age = {...} +local videoUrl = age[1] +local debug + +if age[2] == "debug" then + debug = true +end + if not videoUrl then print("Usage: video_player