
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
simplejsonspider 是一个超简单的 Python 工具包,用于请求指定的 JSON API 并将返回内容自动保存为本地 JSON 文件。你只需要指定接口地址、文件名模板和存储路径,即可“一键抓取、自动存储”。注意:该工具包仅支持 JSON 格式的 API 响应。用GPT 4.1 只花了15分钟写的。
{id}_{title}.json
pip install simplejsonspider
from simplejsonspider import SimpleJSONSpider
id = 1
title = 'delectus aut autem'
# 创建一个简单的 JSON API 抓取器
spider = SimpleJSONSpider(
api_url='https://jsonplaceholder.typicode.com/todos/1', # API接口
filename_template='{id}_{title}.json', # 文件名模板(对应API返回的字段)
storage_dir='./data' # 存储目录
)
spider.run()
执行后,将自动在 ./data
目录下生成如 1_delectus aut autem.json
的文件,内容即API返回的JSON。
有些网站需要带自定义User-Agent、Referer或Cookie,直接传递即可:
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"Referer": "https://www.bilibili.com/"
}
cookies = {
"SESSDATA": "your_cookie"
}
spider = SimpleJSONSpider(
api_url='https://jsonplaceholder.typicode.com/todos/1', # 示例API接口
filename_template='{code}.json', # 根据API返回的字段
storage_dir='./bili_data',
headers=headers,
cookies=cookies
)
spider.run()
{id}_{title}.json
遇到 412、403 等错误? 请添加正确的 User-Agent、Referer 或 Cookie(详见进阶用法)。
保存多个API数据? 可在循环中多次创建 SimpleJSONSpider 实例,或自己扩展批量功能。
MIT License
[Zeturn] [GitHub主页]
---
FAQs
A simple package to crawl JSON APIs and save response to local files.
We found that simplejsonspider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.