Skip to content

Commit 63df9f6

Browse files
committed
feat: 添加轻量模式支持并更新文档
添加轻量模式支持,包括不同的依赖文件、Vercel配置和功能降级处理。更新README以说明不同安装选项和平台限制。
1 parent 29f0ed1 commit 63df9f6

File tree

6 files changed

+47
-13
lines changed

6 files changed

+47
-13
lines changed

.vercelignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uv.lock
2+
pyproject.toml
3+
Pipfile
4+
Pipfile.lock
5+
.python-version

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ COPY . .
88

99
# Install Python dependencies
1010
# Official image has system dependencies, we just need python deps
11-
RUN pip install --no-cache-dir -r requirements.txt && \
11+
RUN pip install --no-cache-dir -r requirements-full.txt && \
1212
playwright install chromium
1313

1414
# Set production environment variables

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ uv sync
3030
uv run flask run
3131
```
3232

33+
> **Note**: For full features (Playwright, PDF processing, etc.), use `pip install -r requirements-full.txt` instead of the default `requirements.txt`.
34+
3335
---
3436

3537
## 🛠 Advanced Features
@@ -64,10 +66,8 @@ docker run -d \
6466

6567
### Cloud Platforms
6668
- **Vercel**: [![Deploy with Vercel](https://vercel.app/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhillerliao%2Frsshub-python)
67-
> **Note**: To resolve the 250MB limit on Vercel:
68-
> 1. Go to your Vercel Project **Settings** > **Build & Development**.
69-
> 2. Toggle **Override** for **Install Command**.
70-
> 3. Enter: `pip install -r requirements-lite.txt`.
69+
> **Note**: The project is pre-configured for Vercel Lite Mode via `vercel.json`. It uses `requirements-lite.txt` to avoid the 250MB size limit.
70+
> Advanced features like Playwright and PDF parsing are disabled in Lite Mode.
7171
7272
- **Zeabur**: Supports both Git integration and pre-built Docker images.
7373

requirements-full.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
arrow==1.2.2
2+
beautifulsoup4==4.11.1
3+
Bootstrap_Flask==1.8.0
4+
click==8.0.3
5+
cssselect==1.2.0
6+
feedparser==6.0.8
7+
Flask==2.0.2
8+
gunicorn
9+
Werkzeug==2.0.3
10+
Flask_Analytics==0.6.0
11+
Flask_Caching==2.0.2
12+
Flask_DebugToolbar==0.11.0
13+
Flask_Moment==1.0.2
14+
icecream==2.1.1
15+
Jinja2==3.0.3
16+
playwright
17+
ptpython==3.0.31
18+
pyjsparser==2.7.1
19+
pyppeteer
20+
python-dotenv==1.2.1
21+
pytz==2025.2
22+
Requests==2.32.5
23+
setuptools==80.9.0
24+
undetected_chromedriver==3.5.5
25+
trafilatura
26+
EbookLib>=0.17.1
27+
mobi>=0.3.3
28+
pymupdf>=1.25.0

requirements.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,9 @@ Flask_DebugToolbar==0.11.0
1313
Flask_Moment==1.0.2
1414
icecream==2.1.1
1515
Jinja2==3.0.3
16-
playwright
1716
ptpython==3.0.31
1817
pyjsparser==2.7.1
19-
pyppeteer
2018
python-dotenv==1.2.1
2119
pytz==2025.2
2220
Requests==2.32.5
2321
setuptools==80.9.0
24-
undetected_chromedriver==3.5.5
25-
trafilatura
26-
EbookLib>=0.17.1
27-
mobi>=0.3.3
28-
pymupdf>=1.25.0

rsshub/blueprints/proxy.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import requests
22
from flask import Blueprint, request, Response
3-
import trafilatura
3+
4+
try:
5+
import trafilatura
6+
HAS_TRAFILATURA = True
7+
except ImportError:
8+
HAS_TRAFILATURA = False
49

510
bp = Blueprint('proxy', __name__, url_prefix='/proxy')
611

@@ -10,6 +15,9 @@
1015

1116
@bp.route('/readability')
1217
def readability():
18+
if not HAS_TRAFILATURA:
19+
return "Error: Trafilatura not available in Lite Mode. This feature requires the full installation.", 503
20+
1321
url = request.args.get('url')
1422
proxy_url = request.args.get('proxy')
1523

0 commit comments

Comments
 (0)