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 } ] } 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