mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
@@ -286,7 +286,8 @@ func (m *Manager) executeWithProvider(ctx context.Context, provider string, req
|
||||
} else if accountType == "oauth" {
|
||||
log.Debugf("Use OAuth %s for model %s", accountInfo, req.Model)
|
||||
} else if accountType == "cookie" {
|
||||
log.Debugf("Use Cookie %s for model %s", util.HideAPIKey(accountInfo), req.Model)
|
||||
// Only Gemini Web uses cookie; print stable account label as-is.
|
||||
log.Debugf("Use Cookie %s for model %s", accountInfo, req.Model)
|
||||
}
|
||||
|
||||
tried[auth.ID] = struct{}{}
|
||||
@@ -333,7 +334,7 @@ func (m *Manager) executeCountWithProvider(ctx context.Context, provider string,
|
||||
} else if accountType == "oauth" {
|
||||
log.Debugf("Use OAuth %s for model %s", accountInfo, req.Model)
|
||||
} else if accountType == "cookie" {
|
||||
log.Debugf("Use Cookie %s for model %s", util.HideAPIKey(accountInfo), req.Model)
|
||||
log.Debugf("Use Cookie %s for model %s", accountInfo, req.Model)
|
||||
}
|
||||
|
||||
tried[auth.ID] = struct{}{}
|
||||
@@ -380,7 +381,7 @@ func (m *Manager) executeStreamWithProvider(ctx context.Context, provider string
|
||||
} else if accountType == "oauth" {
|
||||
log.Debugf("Use OAuth %s for model %s", accountInfo, req.Model)
|
||||
} else if accountType == "cookie" {
|
||||
log.Debugf("Use Cookie %s for model %s", util.HideAPIKey(accountInfo), req.Model)
|
||||
log.Debugf("Use Cookie %s for model %s", accountInfo, req.Model)
|
||||
}
|
||||
|
||||
tried[auth.ID] = struct{}{}
|
||||
|
||||
@@ -129,6 +129,13 @@ func (a *Auth) AccountInfo() (string, string) {
|
||||
return "", ""
|
||||
}
|
||||
if strings.ToLower(a.Provider) == "gemini-web" {
|
||||
// Prefer explicit label written into auth file (e.g., gemini-web-<hash>)
|
||||
if a.Metadata != nil {
|
||||
if v, ok := a.Metadata["label"].(string); ok && strings.TrimSpace(v) != "" {
|
||||
return "cookie", strings.TrimSpace(v)
|
||||
}
|
||||
}
|
||||
// Minimal fallback to cookie value for backward compatibility
|
||||
if a.Metadata != nil {
|
||||
if v, ok := a.Metadata["secure_1psid"].(string); ok && v != "" {
|
||||
return "cookie", v
|
||||
@@ -137,14 +144,6 @@ func (a *Auth) AccountInfo() (string, string) {
|
||||
return "cookie", v
|
||||
}
|
||||
}
|
||||
if a.Attributes != nil {
|
||||
if v := a.Attributes["secure_1psid"]; v != "" {
|
||||
return "cookie", v
|
||||
}
|
||||
if v := a.Attributes["api_key"]; v != "" {
|
||||
return "cookie", v
|
||||
}
|
||||
}
|
||||
}
|
||||
if a.Metadata != nil {
|
||||
if v, ok := a.Metadata["email"].(string); ok {
|
||||
|
||||
Reference in New Issue
Block a user