From 53a22a6b4216ea7cabdda5f86abb13d5893f6d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=8A=E6=99=9A=E6=89=93=E8=80=81=E8=99=8E?= Date: Wed, 22 Apr 2026 14:42:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E6=8A=95=E7=A8=BF]=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=84=9A=E6=9C=AC:=20=E5=B0=8F=E5=A7=90=E5=A7=90=E8=A7=86?= =?UTF-8?q?=E9=A2=91=20=E2=80=94=20by=20=E6=9E=95=E9=97=B2=E9=B1=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script_library/scripts/ui/script_mo9oqex4.py | 77 ++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 script_library/scripts/ui/script_mo9oqex4.py diff --git a/script_library/scripts/ui/script_mo9oqex4.py b/script_library/scripts/ui/script_mo9oqex4.py new file mode 100644 index 0000000..937458f --- /dev/null +++ b/script_library/scripts/ui/script_mo9oqex4.py @@ -0,0 +1,77 @@ +import ui +import requests +import storage +import dialogs + +# ===== 接口 ===== +API = "http://api.yujn.cn/api/zzxjj.php" + +# ===== 获取真实视频 ===== +def get_real_url(): + try: + r = requests.get(API, timeout=10) + + # 跳转地址 + if r.url != API: + return r.url + + # 返回文本是URL + if r.text.startswith("http"): + return r.text.strip() + + except Exception as e: + print("获取失败:", e) + + return None + +# ===== HTML播放器 ===== +def build_html(url): + return f""" + + + + + + + + + """ + +# ===== 主程序 ===== +class VideoApp(ui.View): + + def __init__(self): + super().__init__() + + self.background_color = "black" + + # 播放器 + self.web = ui.WebView(frame=self.bounds, flex="WH") + self.add_subview(self.web) + # 按钮 + self.button = ui.Button(title="切换视频", frame=(0, 0, 150, 50)) # 初始位置设为 (0, 0) + self.button.action = self.play_video + self.add_subview(self.button) + + # 首次运行显示使用说明 + + dialogs.alert("使用说明", "欢迎使用本应用!\n刷新视频点击切换视频\n播放后找不到切换按钮点击右上X按钮\n换视频较慢!") + + # ===== 播放视频 ===== + def play_video(self, sender): + url = get_real_url() + if url: + print("播放:", url) + self.web.load_html(build_html(url)) + else: + print("无法获取视频 URL") + +# ===== 启动 ===== +if __name__ == "__main__": + + v = VideoApp() + w, h = ui.get_screen_size() + v.frame = (0, 0, w, h) + # 设置按钮位置为屏幕中心,并以模态形式显示 + v.present("sheet", animated=True, hide_title_bar=True) \ No newline at end of file From 0ce0ccdc70483a1217c107243e44e35f999b6c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=8A=E6=99=9A=E6=89=93=E8=80=81=E8=99=8E?= Date: Wed, 22 Apr 2026 14:42:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E6=8A=95=E7=A8=BF]=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20index.json:=20=E6=B7=BB=E5=8A=A0=20=E5=B0=8F=E5=A7=90?= =?UTF-8?q?=E5=A7=90=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script_library/index.json | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/script_library/index.json b/script_library/index.json index c95a8bd..974c644 100644 --- a/script_library/index.json +++ b/script_library/index.json @@ -1,7 +1,7 @@ { "format_version": 1, - "data_version": 99, - "updated": "2026-04-21T12:29:23.484Z", + "data_version": 100, + "updated": "2026-04-22T06:42:07.854Z", "announcement": null, "categories": [ { @@ -1654,6 +1654,29 @@ "updated": null, "status": "active", "lines": 642 + }, + { + "id": "script_mo9oqex4", + "name": "小姐姐视频", + "name_en": "小姐姐视频", + "desc": "没事瞎闹", + "desc_en": "没事瞎闹", + "category": "ui", + "file": "scripts/ui/script_mo9oqex4.py", + "thumbnail": null, + "version": 1, + "file_type": "py", + "author": "枕闲鱼", + "author_en": "枕闲鱼", + "tags": [ + "community" + ], + "requires": [], + "min_app_version": "1.5.0", + "added": "2026-04-22", + "updated": null, + "status": "active", + "lines": 77 } ] }