fish2018/pansou · error

[ ] 所有搜索任务都失败

Error message

[%s] 所有搜索任务都失败

What it means

The SDSO search plugin (searchImpl) fans out concurrent page-fetch tasks across all supported cloud-drive types. This error is returned only when successTasks == 0, i.e. every single page request for every cloud type failed (network errors, non-200 status, JSON parse errors, or API-level errors), so no results could be collected at all.

Solutions

  1. Verify network connectivity to https://sdso.top/api/sd/search from the host (curl the endpoint with a keyword).
  2. Enable the plugin's DebugLog to see the per-task underlying errors (each task's wrapped error is printed).
  3. Check whether sdso.top is rate-limiting or blocking (429/403); reduce concurrency/pages per type or add delays.
  4. Check whether the site changed its API contract (APIResponse shape or URL) and update the plugin accordingly.
  5. As a user, disable the sdso plugin or rely on other plugins, since the aggregator typically continues with other sources.

Example fix

// before
results, err := sdsoPlugin.Search(ctx, keyword)
if err != nil { log.Fatal(err) }
// after
results, err := sdsoPlugin.Search(ctx, keyword)
if err != nil {
    log.Printf("sdso source unavailable, continuing with other sources: %v", err)
    results = nil
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Go: probe the source before relying on it
resp, err := http.Get("https://sdso.top/api/sd/search?name=test&pageNo=1&from=baidu")
if err != nil { /* sdso unavailable, skip this plugin */ }

Try / catch

results, err := plugin.Search(ctx, keyword)
if err != nil {
    log.Printf("sdso source failed (all page tasks): %v", err)
    results = nil // continue with other sources
}

Prevention

When it happens

Trigger: Calling the plugin's Search (searchImpl) when every underlying fetchSinglePageWithType task fails: sdso.top is unreachable/down, DNS failure, the site blocks the client (4xx/5xx), the API returns non-200 body codes (e.g. rate-limit or captcha), or responses are not valid JSON.

Common situations: Running the aggregator in an environment without internet access; sdso.top being temporarily down or having changed its API; the site rate-limiting or anti-bot-blocking the scraper's User-Agent/IP; a corporate proxy/firewall blocking sdso.top.

Related errors


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

Appendix: source

Thrown at plugin/sdso/sdso.go:207

		successTasks++
		allResults = append(allResults, pageResult.results...)
		resultsByType[pageResult.fromType] += len(pageResult.results)
		if DebugLog {
			fmt.Printf("[%s] %s网盘第%d页成功获取 %d 个结果\n", p.Name(), pageResult.fromType, pageResult.pageNo, len(pageResult.results))
		}
	}

	if DebugLog {
		fmt.Printf("[%s] 分类搜索完成: 成功%d任务, 失败%d任务, 总结果%d个\n", 
			p.Name(), successTasks, errorTasks, len(allResults))
		for cloudType, count := range resultsByType {
			fmt.Printf("[%s]   - %s网盘: %d个结果\n", p.Name(), cloudType, count)
		}
	}

	// 4. 如果所有任务都失败,返回错误
	if successTasks == 0 {
		return nil, fmt.Errorf("[%s] 所有搜索任务都失败", p.Name())
	}

	// 5. 关键词过滤
	beforeFilterCount := len(allResults)
	filteredResults := plugin.FilterResultsByKeyword(allResults, keyword)
	
	if DebugLog {
		fmt.Printf("[%s] 关键词过滤: 过滤前%d项 -> 过滤后%d项\n", 
			p.Name(), beforeFilterCount, len(filteredResults))
	}

	return filteredResults, nil
}

// fetchSinglePageWithType 获取指定网盘类型的单页数据
func (p *SDSOPlugin) fetchSinglePageWithType(client *http.Client, keyword string, pageNo int, fromType string) ([]model.SearchResult, error) {
	// 1. 构建搜索URL,添加from参数指定网盘类型
	searchURL := fmt.Sprintf("https://sdso.top/api/sd/search?name=%s&pageNo=%d&from=%s", 

View on GitHub (pinned to beaa561337)