From 295bd18719d37546d81b5b838a0ecdede2de3c84 Mon Sep 17 00:00:00 2001 From: nnwang <10577303+nnwang@user.noreply.gitee.com> Date: Sun, 22 Feb 2026 04:39:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=80=A7=E8=83=BD=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=20=E5=8A=A0=E5=85=A5=E5=B8=A7=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E8=87=AA=E5=8A=A8=E8=B7=B3=E5=B8=A7=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=A7=A3=E7=A0=81=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- play.lua | 250 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 179 insertions(+), 71 deletions(-) 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