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
@@ -12,4 +12,6 @@ func registerRemoveWatermarkRoutes(api *gin.RouterGroup, protected *gin.RouterGr
protected.POST("/video/remove_watermark/unlock", videoHandler.UnlockQuota)
// 下载失败上报:供其他服务调用,无需鉴权
api.POST("/video/remove_watermark/report_failure", videoHandler.ReportDownloadFailure)
// 媒体代理:用于中转视频/图片等资源,绕过微信域名限制,无需鉴权
api.GET("/video/proxy", videoHandler.ProxyMedia)
}