fish2018/pansou · error

u3c3 所有域名均不可用

Error message

u3c3 所有域名均不可用

What it means

The u3c3 plugin searches multiple mirror domains for a hidden 'search2' form parameter required to build search queries. If every candidate domain fails (network errors, blocked domains, or page markup changes prevent extracting search2), lastErr stays nil only if no domain attempt even produced an error, and the plugin throws 'u3c3 所有域名均不可用' (all domains unavailable). It means the plugin could not bootstrap a working search endpoint at all.

Solutions

  1. Check network connectivity from the host to the u3c3 mirror domains (curl one of them)
  2. Update the domain list in the plugin to the current mirrors
  3. Re-inspect the homepage HTML and update the search2 extraction logic if the markup changed
  4. Use a proxy or deploy the service in a region where the domains are reachable
  5. Report/patch the plugin if the site is permanently dead

Example fix

// before
search2, err := p.getSearch2Parameter()
if err != nil { return nil, err }
// after
search2, err := p.getSearch2Parameter()
if err != nil {
    log.Warnf("u3c3 unavailable: %v, falling back to next plugin", err)
    return p.fallbackSearch(query)
}
Defensive patterns

Strategy: fallback

Validate before calling

func u3c3Available(domains []string) bool {
    for _, d := range domains {
        resp, err := http.Get("https://" + d)
        if err == nil {
            resp.Body.Close()
            return true
        }
    }
    return false
}

Try / catch

results, err := u3c3Plugin.SearchWithResult(ctx, query)
if err != nil {
    log.Warn("u3c3 unavailable, skipping: %v", err)
    results = emptyResults // continue with other plugins
}

Prevention

When it happens

Trigger: Calling SearchWithResult or TestU3c3LiveSearch when: all configured u3c3 mirror domains fail to load (DNS/network/firewall), the homepage HTML no longer contains the search2 parameter (site markup change), or the site blocks requests (bot detection, geo-block).

Common situations: Running in an environment with no internet or a firewall blocking these pirate-index domains; the u3c3 site changed its homepage structure or rotated domains; ISP/GFW blocking; server egress restrictions in CI.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at plugin/u3c3/u3c3.go:187

		if lastErr != nil || resp == nil || resp.StatusCode != 200 {
			continue
		}
		body, readErr := io.ReadAll(resp.Body)
		resp.Body.Close()
		if readErr != nil {
			lastErr = readErr
			continue
		}
		search2 = p.extractSearch2FromHTML(string(body))
		if search2 != "" {
			p.setActiveURL(baseURL)
			break
		}
		lastErr = fmt.Errorf("无法从首页提取search2参数")
	}
	if search2 == "" {
		if lastErr == nil {
			lastErr = fmt.Errorf("u3c3 所有域名均不可用")
		}
		return "", lastErr
	}

	// 缓存参数
	p.search2 = search2
	p.lastSync = time.Now()

	if p.debugMode {
		log.Printf("[U3C3] 获取到search2参数: %s", search2)
	}

	return search2, nil
}

// extractSearch2FromHTML 从HTML中提取search2参数
func (p *U3c3Plugin) extractSearch2FromHTML(html string) string {
	// 按行处理,排除注释行

View on GitHub (pinned to beaa561337)