{"record":{"id":"ebd66cb575b21462","repo":"fish2018/pansou","slug":"d-ebd66c","errorCode":null,"errorMessage":"搜索请求失败，状态码: %d","messagePattern":"搜索请求失败，状态码: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/u3c3/u3c3.go","lineNumber":297,"sourceCode":"\t\tresp, lastErr = client.Do(req)\n\t\tif lastErr == nil && resp.StatusCode == 200 {\n\t\t\tbreak\n\t\t}\n\t\tif resp != nil {\n\t\t\tresp.Body.Close()\n\t\t}\n\t\tif i < MaxRetries-1 {\n\t\t\ttime.Sleep(RetryDelay)\n\t\t}\n\t}\n\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"搜索请求失败，状态码: %d\", resp.StatusCode)\n\t}\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p.parseSearchResults(string(body))\n}\n\n// parseSearchResults 解析搜索结果\nfunc (p *U3c3Plugin) parseSearchResults(html string) ([]model.SearchResult, error) {\n\tdoc, err := goquery.NewDocumentFromReader(strings.NewReader(html))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar results []model.SearchResult","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/u3c3/u3c3.go#L279-L315","documentation":"doSearch sends the search request to the u3c3 site and requires HTTP 200. Any other status (403 anti-bot, 429 rate limit, 5xx, redirects to CAPTCHA pages) results in this error. It is a guard ensuring the response body is only parsed for a successful search page.","triggerScenarios":"SearchWithResult or TestU3c3LiveSearch reaching doSearch when the server responds with a non-200 status: 403 from Cloudflare/anti-bot, 429 rate limiting, 503 during site maintenance, or 30x not followed.","commonSituations":"Sending too many rapid requests and being rate-limited; the mirror serving a Cloudflare challenge; the site being under maintenance; stale domain redirecting to a block page.","solutions":["Log resp.StatusCode and retry after a delay for 429/5xx","Add browser-like headers (User-Agent, Referer, cookies) to pass anti-bot checks","Try another mirror domain","Route through a proxy/residential IP if the IP is blocked","Check the site manually in a browser to see what the status corresponds to"],"exampleFix":"// before\nif resp.StatusCode != 200 {\n    return nil, fmt.Errorf(\"搜索请求失败，状态码: %d\", resp.StatusCode)\n}\n// after\nif resp.StatusCode == 429 {\n    time.Sleep(retryAfter)\n    return p.doSearch(query) // retry\n}\nif resp.StatusCode != 200 {\n    return nil, fmt.Errorf(\"搜索请求失败，状态码: %d\", resp.StatusCode)\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"results, err := u3c3Plugin.SearchWithResult(ctx, query)\nvar httpErr *HTTPStatusError\nif errors.As(err, &httpErr) && (httpErr.Code == 429 || httpErr.Code >= 500) {\n    time.Sleep(backoff)\n    results, err = u3c3Plugin.SearchWithResult(ctx, query)\n}","preventionTips":["Throttle request rate to the mirror","Rotate User-Agent/cookies to avoid anti-bot blocks","Fail over to another domain on non-200","Monitor status codes to detect new blocks early"],"tags":["http","network","scraping","status-code"],"backgroundTag":"http-non-200-response","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}