From c73bee391cac73fcd48c60bcd209649ce03bd8a3 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: Sat, 28 Mar 2026 11:12:57 +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=AE=9E=E6=97=B6=E7=94=B5=E5=BD=B1?= =?UTF-8?q?=E7=A5=A8=E6=88=BF=20=E2=80=94=20by=20=E4=B8=80=E5=8F=AA?= =?UTF-8?q?=E8=8F=9C=E9=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/widgets/script_mn9r95l0.py | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 script_library/scripts/widgets/script_mn9r95l0.py diff --git a/script_library/scripts/widgets/script_mn9r95l0.py b/script_library/scripts/widgets/script_mn9r95l0.py new file mode 100644 index 0000000..76157c5 --- /dev/null +++ b/script_library/scripts/widgets/script_mn9r95l0.py @@ -0,0 +1,87 @@ +from widget import Widget, family, SMALL, MEDIUM, LARGE +import requests + +def safe_text(val, default=""): + return val if val and val.strip() else default + +try: + headers = {"Content-Type": "application/x-www-form-urlencoded;charset:utf-8"} + resp = requests.post( + "https://api.taolale.com/api/hot_rankings/get", + data={"key": "DoG1KYTwfGhcTACTpgAk4eFiDf"}, + headers=headers, + timeout=10 + ) + data = resp.json() + movies = data.get("data", [])[:5] if data.get("code") == 200 else [] +except: + movies = [] + +bg = ("#F8FAFC", "#0F172A") +title_color = ("#0F172A", "#F8FAFC") +subtitle_color = ("#647B94", "#94A3B8") +accent = "#EF4444" + +w = Widget(background=bg, padding=14) + +if family == SMALL: + top = movies[0] if movies else None + with w.vstack(spacing=0, align="leading"): + w.spacer(24) + if top: + w.icon("film.fill", size=18, color=accent) + w.spacer(8) + w.text(top["title"], size=17, weight="bold", color=title_color, max_lines=1) + w.spacer(6) + w.text(top["sumBoxDesc"], size=24, weight="bold", design="rounded", color=title_color) + release_info = safe_text(top.get("releaseInfo")) + if release_info: + w.spacer(6) + w.text(release_info, size=12, color=subtitle_color) + else: + w.text("暂无数据", size=16, color=subtitle_color) + w.spacer() + +elif family == MEDIUM: + with w.hstack(spacing=0): + w.icon("film.fill", size=15, color=accent) + w.spacer(6) + w.text("实时票房前三", size=14, weight="semibold", color=title_color) + w.spacer() + #w.text(f"共{len(movies)}部", size=12, color=subtitle_color) + w.spacer() + for movie in movies[:3]: + rank = movie["index"] + rc = "#F59E0B" if rank == 1 else "#94A3B8" if rank == 2 else "#CD7F32" + with w.hstack(spacing=0, align="center"): + w.text(f"#{rank}", size=13, weight="bold", color=rc) + w.spacer(6) + w.text(movie["title"], size=13, weight="medium", color=title_color) + w.spacer() + w.text(movie["sumBoxDesc"], size=13, weight="bold", design="rounded", color=title_color) + w.spacer(4) + w.spacer() + +else: + with w.hstack(spacing=0): + w.icon("film.fill", size=17, color=accent) + w.spacer(8) + w.text("实时票房榜", size=17, weight="bold", color=title_color) + w.spacer() + w.text(f"共{len(movies)}部", size=13, color=subtitle_color) + w.spacer(12) + for movie in movies: + rank = movie["index"] + rc = "#F59E0B" if rank == 1 else "#94A3B8" if rank == 2 else "#CD7F32" + release_info = safe_text(movie.get("releaseInfo")) + with w.hstack(spacing=0, align="center"): + w.text(f"#{rank}", size=15, weight="bold", color=rc) + w.spacer(8) + w.text(movie["title"], size=15, weight="semibold", color=title_color) + if release_info: + w.text(f" · {release_info}", size=12, color=subtitle_color) + w.spacer() + w.text(movie["sumBoxDesc"], size=16, weight="bold", design="rounded", color=title_color) + w.spacer(6) + +w.render() \ No newline at end of file From fdc0aff0f563707659affba43d081feb566ca219 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: Sat, 28 Mar 2026 11:13:00 +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=AE=9E=E6=97=B6?= =?UTF-8?q?=E7=94=B5=E5=BD=B1=E7=A5=A8=E6=88=BF?= 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 22c98f2..eb7738c 100644 --- a/script_library/index.json +++ b/script_library/index.json @@ -1,7 +1,7 @@ { "format_version": 1, - "data_version": 31, - "updated": "2026-03-27T15:15:38.324Z", + "data_version": 32, + "updated": "2026-03-28T03:12:59.398Z", "announcement": null, "categories": [ { @@ -798,6 +798,29 @@ "updated": null, "status": "active", "lines": 113 + }, + { + "id": "script_mn9r95l0", + "name": "实时电影票房", + "name_en": "实时电影票房", + "desc": "建议用中号小组件", + "desc_en": "建议用中号小组件", + "category": "widgets", + "file": "scripts/widgets/script_mn9r95l0.py", + "thumbnail": null, + "version": 1, + "file_type": "py", + "author": "一只菜鸡", + "author_en": "一只菜鸡", + "tags": [ + "community" + ], + "requires": [], + "min_app_version": "1.5.0", + "added": "2026-03-28", + "updated": null, + "status": "active", + "lines": 87 } ] }