{"record":{"id":"66a53fd904fd0e12","repo":"fish2018/pansou","slug":"s-w-66a53f","errorCode":null,"errorMessage":"[%s] 获取分享链接失败: %w","messagePattern":"\\[(.+?)\\] 获取分享链接失败: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/yingso/yingso.go","lineNumber":170,"sourceCode":"\n\twg.Wait()\n\tclose(resultCh)\n\n\tvar firstErr error\n\tresolvedCount := 0\n\tfor item := range resultCh {\n\t\tif item.err != nil {\n\t\t\tif firstErr == nil {\n\t\t\t\tfirstErr = item.err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tresolved[item.index] = item.result\n\t\tvalid[item.index] = true\n\t\tresolvedCount++\n\t}\n\tif resolvedCount == 0 && firstErr != nil {\n\t\treturn nil, fmt.Errorf(\"[%s] 获取分享链接失败: %w\", p.Name(), firstErr)\n\t}\n\n\tresults := make([]model.SearchResult, 0, resolvedCount)\n\tseen := make(map[string]struct{}, resolvedCount)\n\tfor index, result := range resolved {\n\t\tif !valid[index] || len(result.Links) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tlinkKey := result.Links[0].URL + \"\\x00\" + result.Links[0].Password\n\t\tif _, exists := seen[linkKey]; exists {\n\t\t\tcontinue\n\t\t}\n\t\tseen[linkKey] = struct{}{}\n\t\tresults = append(results, result)\n\t}\n\n\treturn plugin.FilterResultsByKeyword(results, keyword), nil\n}","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/yingso/yingso.go#L152-L188","documentation":"searchImpl resolves share links for each search hit concurrently; if every resolution attempt failed (resolvedCount == 0) and at least one error was captured, it wraps the first error (firstErr) with 获取分享链接失败. This means none of the results could get a usable share link, so no results are returned.","triggerScenarios":"All concurrent requests to resolve share links for the found items failed — network errors, upstream timeouts, anti-bot blocks, or invalid item metadata (e.g. missing share IDs) — so resolvedCount stayed 0.","commonSituations":"Yingso upstream is down or blocking the client IP; expired session/cookies cause every link-resolution call to fail; network outage or proxy misconfiguration on the host running the plugin.","solutions":["Inspect the wrapped firstErr (%w) for the root cause — network error vs HTTP status vs parse failure.","Test connectivity to the Yingso upstream from the host (curl the endpoint).","If authentication/cookies are involved, refresh them.","Add retry with backoff for transient network failures."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"results, err := search(keyword)\nif err != nil {\n    if strings.Contains(err.Error(), \"获取分享链接失败\") {\n        log.Printf(\"all share-link resolutions failed: %v\", err)\n        return cachedOrEmptyResults\n    }\n    return err\n}","preventionTips":["Add retries with exponential backoff for link resolution.","Check host network/proxy configuration before deploying.","Refresh upstream credentials/sessions regularly.","Monitor upstream availability and degrade gracefully to cached results."],"tags":["network","upstream-error","http"],"backgroundTag":"upstream-api-error","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"}