Add media proxy feature for resource downloading

- Introduced a new API endpoint `GET /api/v1/video/proxy` to facilitate media resource downloads, allowing users to bypass domain restrictions imposed by WeChat.
- Updated configuration to include proxy settings such as `SHORT_VIDEO_PROXY_ENABLED`, `SHORT_VIDEO_PROXY_ALLOWED_DOMAINS`, `SHORT_VIDEO_PROXY_MAX_SIZE_MB`, and `SHORT_VIDEO_PROXY_TIMEOUT_SECONDS`.
- Enhanced the `ShortVideoConfig` struct to accommodate new proxy-related fields.
- Improved error handling for proxy requests, including checks for allowed domains and file size limits.
- Updated documentation to reflect the new proxy functionality and its configuration options, ensuring clarity for users and developers.
This commit is contained in:
nepiedg
2026-02-06 11:28:02 +00:00
parent 9200600b1c
commit 1b8ff310eb
7 changed files with 1049 additions and 3 deletions
+9
View File
@@ -23,6 +23,15 @@ JWT_SECRET=your-secret-key-change-in-production
SHORT_VIDEO_API_KEY=replace-with-real-key
SHORT_VIDEO_FREE_QUOTA=20
SHORT_VIDEO_TIMEOUT_SECONDS=5
# 媒体代理配置(用于中转下载,绕过微信域名限制)
SHORT_VIDEO_PROXY_ENABLED=true
# 允许代理的域名白名单(留空表示允许所有,不推荐)
# 多个域名用逗号分隔,例如:cdn.example.com,video.example.com
SHORT_VIDEO_PROXY_ALLOWED_DOMAINS=
# 代理文件最大大小(MB
SHORT_VIDEO_PROXY_MAX_SIZE_MB=100
# 代理请求超时(秒)
SHORT_VIDEO_PROXY_TIMEOUT_SECONDS=60
# AI 配置(OpenAI-compatible
# 例:OpenAI = https://api.openai.com/v1