fish2018/pansou · error

未找到搜索结果页面重定向信息

Error message

未找到搜索结果页面重定向信息

What it means

xb6v's search protocol relies on the search POST returning a redirect (Location header, JS location.href, meta refresh, or a result/?searchid=... URL). When no Location header is present, the plugin parses the body with three regex strategies; if none yields a redirect target, it throws this error, meaning the expected redirect flow was not followed.

Solutions

  1. Try a different keyword; a rejected/empty search often produces a non-redirect error page.
  2. Verify the configured mirror base URL is current — outdated mirrors commonly break the redirect flow.
  3. Enable debug mode to dump the first 500 chars of the response body and confirm what the site actually returned (captcha/error page vs layout change).
  4. Update the plugin's extraction regexes if the site changed its redirect format (e.g. new parameter name instead of searchid).
Defensive patterns

Strategy: fallback

Validate before calling

// sanity-check keyword before searching
kw := strings.TrimSpace(keyword)
if kw == "" { return errors.New("keyword is empty") }

Try / catch

results, err := pluginSearch(keyword)
if err != nil && strings.Contains(err.Error(), "未找到搜索结果页面重定向信息") {
	// treat as 'site flow changed or no results' — try alternate plugin/mirror
	results, err = fallbackPlugin.Search(keyword)
}

Prevention

When it happens

Trigger: The POST to /e/search/index.php succeeds (HTTP response received) but contains no Location header and the body contains none of: location.href assignment, href/url= with searchid, or result/?searchid=N pattern — e.g. the site returned an error page, a captcha, a 'no results' page, or changed its redirect mechanism.

Common situations: The xb6v mirror changed its search backend and no longer emits searchid redirects; the search keyword was rejected and an error page was returned; the site is behind anti-bot protection serving a challenge page; site template update removed the JS/meta redirect.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at plugin/xb6v/xb6v.go:267

					break
				}
			}
		}

		// 如果还是没找到,尝试查找简单的result/?searchid=格式
		if location == "" {
			re := regexp.MustCompile(`result/\?searchid=\d+`)
			match := re.FindString(bodyStr)
			if match != "" {
				location = match
				if p.debugMode {
					log.Printf("[Xb6v] 从正则匹配中提取到Location: %s", location)
				}
			}
		}

		if location == "" {
			return nil, fmt.Errorf("未找到搜索结果页面重定向信息")
		}
	}

	// 构建完整的搜索结果URL
	// Location通常是类似 "result/?searchid=39616" 的格式,需要加上 /e/search/ 前缀
	var resultURL string
	if strings.HasPrefix(location, "result/") {
		resultURL = p.currentBase + "/e/search/" + location
	} else {
		resultURL = p.currentBase + "/" + strings.TrimPrefix(location, "/")
	}

	if p.debugMode {
		log.Printf("[Xb6v] 搜索结果页面: %s", resultURL)
	}

	// 第二步:获取搜索结果页面
	resp2, err := p.doRequest(client, "GET", resultURL, "", p.currentBase)

View on GitHub (pinned to beaa561337)