fish2018/pansou · warning

login required

Error message

login required

What it means

errLoginRequired is a sentinel error (errors.New("login required")) defined in plugin/panlian/panlian.go. It signals that the pan (net-disk) search backend requires an authenticated user session, allowing callers to distinguish 'login needed' from other failures. Code paths explicitly check it with errors.Is to stop retries or surface it to users.

Solutions

  1. Re-authenticate: call the login flow (loginWithUser/login endpoint) to refresh cookies before retrying the search
  2. Check errors.Is(err, errLoginRequired) and trigger the login UI/prompt instead of returning a generic failure
  3. Verify stored cookie/session files under storageDir are present and not expired; delete stale ones and log in again
  4. If the site changed its login endpoint/anti-bot behavior, update the plugin's login logic

Example fix

// before
results, err := searchWithUser(ctx, keyword)
if err != nil { return nil, err }
// after
results, err := searchWithUser(ctx, keyword)
if errors.Is(err, errLoginRequired) {
    if _, _, lerr := login(); lerr != nil { return nil, lerr }
    results, err = searchWithUser(ctx, keyword)
}
if err != nil { return nil, err }
Defensive patterns

Strategy: try-catch

Validate before calling

// Go
if cookiesExpired(storedCookies) { triggerReLogin() }

Try / catch

results, err := searchWithUser(ctx, kw)
if errors.Is(err, errLoginRequired) {
    // re-authenticate then retry, or surface 'please login' to user
}

Prevention

When it happens

Trigger: Calling searchWithUser (or the fan-out search at panlian.go:591/660) when no valid cookies/session exist, or after the pan provider has invalidated the session (expired cookies, kicked login, captcha challenge).

Common situations: Stale or missing stored cookies in storageDir after site password change; the remote pan site forcing re-login; running without configuring credentials; concurrent workers all failing with the same expired session.

Related errors


AI-assisted analysis of fish2018/pansou@beaa561337 (2026-09-07). Data as JSON: /api/errors/874cd03e42727300. Report an issue: GitHub.

Appendix: source

Thrown at plugin/panlian/panlian.go:49

	"pansou/util/json"
)

const (
	PluginName        = "panlian"
	DisplayName       = "盘链"
	Description       = "盘链 - 登录后检索影视资源并聚合网盘链接"
	DefaultBaseURL    = "https://pinglian.lol"
	ConfigFileName    = "panlian_config.json"
	RequestTimeout    = 20 * time.Second
	MaxConcurrentJobs = 4
	MaxVideoResults   = 10
	MaxLinksPerResult = 200
)

var (
	storageDir string

	errLoginRequired = errors.New("login required")

	panOrder = map[string]int{
		"quark":   0,
		"uc":      1,
		"baidu":   2,
		"xunlei":  3,
		"123":     4,
		"tianyi":  5,
		"115":     6,
		"aliyun":  7,
		"guangya": 8,
		"mobile":  9,
		"pikpak":  10,
		"magnet":  11,
		"others":  12,
	}

	extractCodeNoiseRegex = regexp.MustCompile(`(?i)([??]?\s*(提取码|访问码|密码)[::]\s*[a-z0-9]{4,8})+$`)

View on GitHub (pinned to beaa561337)