mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
fix(115): resolve direct link via app/chrome/downurl + bind CDN link to client UA
115 deprecated the plain web /files/download endpoint (ordinary cookies no longer get file_url), breaking 302 playback with 'no file_url'. Switch Resolve() to the current proapi.115.com/app/chrome/downurl endpoint, which uses 115's m115 (RSA+XOR) request/response encryption (vendored from the MIT-licensed SheltonZhu/115driver). 115 CDN links are bound to the User-Agent used to request them, so resolve with the playback client's own UA (plumbed from the play handler) — the host can then issue a pure 302 the client fetches directly, preserving true offload. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -90,7 +90,7 @@ func cloudPlayHandler(svc *service.Container) gin.HandlerFunc {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "ref required"})
|
||||
return
|
||||
}
|
||||
link, err := svc.StorageCfg.CloudResolve(c.Request.Context(), typ, ref)
|
||||
link, err := svc.StorageCfg.CloudResolve(c.Request.Context(), typ, ref, c.Request.UserAgent())
|
||||
if err != nil {
|
||||
c.JSON(http.StatusBadGateway, gin.H{"error": err.Error()})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user