mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2026-11-05 22:36:53 +08:00
Refine README updater and relocate script
Workflow: tighten .github/workflows/checkScriptStatus.yml to require README anchor tags (exit with error if missing) instead of blindly appending; set start/end tag placeholders, filter out old table headers, prepend a standardized table header, collect updated names and append new scripts, and reassemble the file to avoid corrupting README format. Script: move changhongmeiling.py into daily/, update file comments and User-Agent, remove an unintended miniapp GET/request block, and apply minor formatting fixes.
This commit is contained in:
1 parent
8b2a3b37d2
commit
acc898d45a
2 files changed
+19
-21
No files matched your search
@@ -65,16 +65,13 @@ jobs:
|
||||
with open(readme_path, 'r', encoding='utf-8') as f:
|
||||
full_text = f.read()
|
||||
|
||||
# 设置正确的标记
|
||||
start_tag = ""
|
||||
end_tag = ""
|
||||
|
||||
# 如果找不到标记,回退到原始追加模式(或者你可以选择报错)
|
||||
if start_tag not in full_text or end_tag not in full_text:
|
||||
print("未发现表格锚点,新内容将追加到末尾。")
|
||||
with open(readme_path, 'a', encoding='utf-8') as f:
|
||||
for s, t in updates.items():
|
||||
f.write(f"| {s} | {t} | ✅ |\n")
|
||||
exit(0)
|
||||
print("未发现表格锚点,请确保 README.md 中包含了 和 ")
|
||||
exit(1) # 找不到锚点直接报错退出,避免破坏文件
|
||||
|
||||
# 核心逻辑:拆分文件 -> 处理表格区 -> 重新拼接
|
||||
pre_part, temp = full_text.split(start_tag)
|
||||
@@ -85,6 +82,7 @@ jobs:
|
||||
updated_names = set()
|
||||
|
||||
for line in lines:
|
||||
# 过滤掉旧的表头,稍后统一添加
|
||||
if line.strip().startswith('|') and '---' not in line and '脚本名称' not in line:
|
||||
parts = [p.strip() for p in line.split('|')]
|
||||
if len(parts) >= 4:
|
||||
@@ -92,16 +90,22 @@ jobs:
|
||||
if name in updates:
|
||||
line = f"| {name} | {updates[name]} | ✅ |"
|
||||
updated_names.add(name)
|
||||
if line.strip():
|
||||
new_table_lines.append(line)
|
||||
if line.strip():
|
||||
new_table_lines.append(line)
|
||||
|
||||
# 把剩余完全没在表格里出现过的新脚本加进去
|
||||
for name, time in updates.items():
|
||||
if name not in updated_names:
|
||||
new_table_lines.append(f"| {name} | {time} | ✅ |")
|
||||
|
||||
# 补回表头(确保表头在最前面)
|
||||
table_header = [
|
||||
"| 脚本名称 | 最后一次更新时间 | 当前状态 |",
|
||||
"| :--- | :----: | :----: |"
|
||||
]
|
||||
new_table_lines = table_header + new_table_lines
|
||||
|
||||
# 重新组装整个文件
|
||||
# 确保表头在最前面
|
||||
final_table = "\n".join(new_table_lines)
|
||||
final_content = f"{pre_part}{start_tag}\n{final_table}\n{end_tag}{post_part}"
|
||||
|
||||
@@ -110,7 +114,6 @@ jobs:
|
||||
EOF
|
||||
|
||||
python update_readme.py
|
||||
|
||||
- name: 提交并推送
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
|
||||
#环境变量 chmlck 取url请求头中的token
|
||||
# 微信小程序长虹智慧家居
|
||||
# new Env("长虹智慧家居每日签到")
|
||||
# 环境变量 chmlck 取url请求头中的token,
|
||||
#变量格式 token#备注,多账号换行
|
||||
#搜微信小程序长虹美菱
|
||||
|
||||
#撸实物加视频会员
|
||||
#
|
||||
import os
|
||||
import requests
|
||||
response = requests.get("#小程序://长虹美菱会员服务/VgBR6WSiyJxrs4G")
|
||||
response.encoding = 'utf-8'
|
||||
txt = response.text
|
||||
print(txt)
|
||||
|
||||
|
||||
accounts = os.getenv("chmlck", "").splitlines()
|
||||
print("☞☞☞ 长虹美菱每日签到 ☜☜☜\n")
|
||||
|
||||
if not accounts:
|
||||
print("未找到任何账号信息。")
|
||||
else:
|
||||
@@ -29,7 +24,7 @@ else:
|
||||
url = "https://hongke.changhong.com/gw/applet/aggr/signin"
|
||||
params = {'aggrId': "608"}
|
||||
headers = {
|
||||
'User-Agent': "Mozilla/5.0 (Linux; Android 10; Mobile Safari/537.36)",
|
||||
'User-Agent': "Mozilla/5.0 (Linux; Android 14; 23116PN5BC Build/UKQ1.230804.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/122.0.6261.120 Mobile Safari/537.36 XWEB/1220099 MMWEBSDK/20240404 MMWEBID/2445 MicroMessenger/8.0.49.2600(0x28003133) WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64 MiniProgramEnv/android",
|
||||
'Accept-Encoding': "gzip, deflate",
|
||||
'Content-Type': "application/json",
|
||||
'Token': token.strip()
|
||||
Reference in new issue
Block a user