From a0d7a09197fcae8c73c31f25c65bf81ec38e7f91 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: Fri, 20 Mar 2026 18:08:22 +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=E8=A7=A3=E6=9E=90=20Cookie=EF=BC=8C?= =?UTF-8?q?=E8=AF=B7=E8=AE=A4=E7=9C=9F=E7=9C=8B=E4=B8=8A=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E9=86=92=E5=93=A6=E3=80=82=20=E2=80=94=20by=20Silence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/basic/cookie_mmyqkjvd.py | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 script_library/scripts/basic/cookie_mmyqkjvd.py diff --git a/script_library/scripts/basic/cookie_mmyqkjvd.py b/script_library/scripts/basic/cookie_mmyqkjvd.py new file mode 100644 index 0000000..224e53b --- /dev/null +++ b/script_library/scripts/basic/cookie_mmyqkjvd.py @@ -0,0 +1,51 @@ +# 欢迎使用 PythonIDE!如果觉得好用,请给个好评哦~ +import re +import os + +def parse_curl_and_save(): + # ⚠️ ,把你用 Stream 抓包复制的那一整坨💩 Curl 代码粘贴到下面三个引号中间 + raw_curl = """放在这里哦不要删除符号哦😊""" + + # --- 1. 暴力正则提取 URL --- + # 匹配 curl 后面的第一个 http/https 链接 + url_match = re.search(r"(?i)curl\s+['\"]?(https?://[^'\"]+)['\"]?", raw_curl) + url = url_match.group(1) if url_match else "❌ 未解析到 URL" + + # --- 2. 暴力正则提取 Cookie --- + # 匹配 -H 'Cookie: xxxx' 里面的内容 + cookie_match = re.search(r"(?i)-H\s+['\"]?Cookie:\s*([^'\"]+)['\"]?", raw_curl) + cookie = cookie_match.group(1) if cookie_match else "❌ 未解析到 Cookie" + + # --- 3. 暴力正则提取 User-Agent --- + # 匹配 -H 'User-Agent: xxxx' 里面的内容 + ua_match = re.search(r"(?i)-H\s+['\"]?User-Agent:\s*([^'\"]+)['\"]?", raw_curl) + user_agent = ua_match.group(1) if ua_match else "❌ 未解析到 User-Agent" + + # --- 4. 组装极度舒适的排版 --- + output_text = ( + " 联通抓包数据解析成功 \n" + "可以直接把下面的内容一段段复制到小组件脚本里了,⚠️host填写m.client.10010.com\n\n" + "================ [ 1. URL 链接 ] ================\n" + f"{url}\n\n" + "================ [ 2. User-Agent ] ================\n" + f"{user_agent}\n\n" + "================ [ 3. Cookie (核心) ] ================\n" + f"{cookie}\n\n" + "=================================================\n" + ) + + # --- 5. 自动创建并保存到新文件 --- + # 会在你的 PythonIDE 当前目录下生成这个 txt 文件 + file_name = "API提取结果.txt" + try: + with open(file_name, "w", encoding="utf-8") as f: + f.write(output_text) + print(f" 搞定!已成功帮你把数据分段提取,并存入了新文件:【{file_name}】\n") + print(" 预览一下内容 记得还有 host 哦臭宝\n") + print(output_text) + except Exception as e: + print(f"❌ 写入文件失败了: {e}") + +if __name__ == "__main__": + parse_curl_and_save() +#2026-3-20 \ No newline at end of file From 04fa90e0395383f24fe41661103060a550fc6772 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: Fri, 20 Mar 2026 18:08:24 +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=E8=A7=A3=E6=9E=90=20Cook?= =?UTF-8?q?ie=EF=BC=8C=E8=AF=B7=E8=AE=A4=E7=9C=9F=E7=9C=8B=E4=B8=8A?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=8F=90=E9=86=92=E5=93=A6=E3=80=82?= 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 1351795..e190d71 100644 --- a/script_library/index.json +++ b/script_library/index.json @@ -1,7 +1,7 @@ { "format_version": 1, - "data_version": 11, - "updated": "2026-03-19T15:52:16.644Z", + "data_version": 12, + "updated": "2026-03-20T10:08:23.591Z", "announcement": null, "categories": [ { @@ -449,6 +449,29 @@ "updated": null, "status": "active", "lines": 85 + }, + { + "id": "cookie_mmyqkjvd", + "name": "解析 Cookie,请认真看上面的提醒哦。", + "name_en": "解析 Cookie,请认真看上面的提醒哦。", + "desc": "这就是解析 Cookie", + "desc_en": "这就是解析 Cookie", + "category": "basic", + "file": "scripts/basic/cookie_mmyqkjvd.py", + "thumbnail": null, + "version": 1, + "file_type": "py", + "author": "Silence", + "author_en": "Silence", + "tags": [ + "community" + ], + "requires": [], + "min_app_version": "1.5.0", + "added": "2026-03-20", + "updated": null, + "status": "active", + "lines": 51 } ] }