恢复端口为16025
This commit is contained in:
22
README.md
22
README.md
@@ -104,18 +104,18 @@ API 信息接口
|
||||
|
||||
```bash
|
||||
# 基础截图
|
||||
curl -X POST http://localhost:16026/api/capture \
|
||||
curl -X POST http://localhost:16025/api/capture \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"url": "https://example.com", "action": "screenshot"}' \
|
||||
--output screenshot.png
|
||||
|
||||
# 提取HTML
|
||||
curl -X POST http://localhost:16026/api/capture \
|
||||
curl -X POST http://localhost:16025/api/capture \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"url": "https://example.com", "action": "html"}'
|
||||
|
||||
# 滚动加载后全页截图
|
||||
curl -X POST http://localhost:16026/api/capture \
|
||||
curl -X POST http://localhost:16025/api/capture \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"url": "https://news.ycombinator.com",
|
||||
@@ -127,7 +127,7 @@ curl -X POST http://localhost:16026/api/capture \
|
||||
--output full_page.png
|
||||
|
||||
# 自定义视口
|
||||
curl -X POST http://localhost:16026/api/capture \
|
||||
curl -X POST http://localhost:16025/api/capture \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"url": "https://example.com",
|
||||
@@ -144,7 +144,7 @@ import requests
|
||||
|
||||
# 截图
|
||||
response = requests.post(
|
||||
'http://localhost:16026/api/capture',
|
||||
'http://localhost:16025/api/capture',
|
||||
json={
|
||||
'url': 'https://example.com',
|
||||
'action': 'screenshot'
|
||||
@@ -155,7 +155,7 @@ with open('screenshot.png', 'wb') as f:
|
||||
|
||||
# 提取HTML
|
||||
response = requests.post(
|
||||
'http://localhost:16026/api/capture',
|
||||
'http://localhost:16025/api/capture',
|
||||
json={
|
||||
'url': 'https://example.com',
|
||||
'action': 'html'
|
||||
@@ -169,7 +169,7 @@ print(html)
|
||||
|
||||
```javascript
|
||||
// 截图
|
||||
const response = await fetch('http://localhost:16026/api/capture', {
|
||||
const response = await fetch('http://localhost:16025/api/capture', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({
|
||||
@@ -182,7 +182,7 @@ const response = await fetch('http://localhost:16026/api/capture', {
|
||||
const blob = await response.blob();
|
||||
|
||||
// 提取HTML
|
||||
const response = await fetch('http://localhost:16026/api/capture', {
|
||||
const response = await fetch('http://localhost:16025/api/capture', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({
|
||||
@@ -199,7 +199,7 @@ console.log(data.html);
|
||||
### 使用 Gunicorn
|
||||
|
||||
```bash
|
||||
gunicorn -w 4 -b 0.0.0.0:16026 app:app
|
||||
gunicorn -w 4 -b 0.0.0.0:16025 app:app
|
||||
```
|
||||
|
||||
### 使用 Systemd 服务
|
||||
@@ -230,12 +230,12 @@ RUN playwright install chromium --with-deps
|
||||
|
||||
COPY . .
|
||||
EXPOSE 5000
|
||||
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:16026", "app:app"]
|
||||
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:16025", "app:app"]
|
||||
```
|
||||
|
||||
```bash
|
||||
docker build -t web-capture-api .
|
||||
docker run -p 16026:16026 web-capture-api
|
||||
docker run -p 16025:16025 web-capture-api
|
||||
```
|
||||
|
||||
## 性能优化
|
||||
|
||||
Reference in New Issue
Block a user