fish2018/pansou · error

[ ] 未能抓取到有效网盘链接

Error message

[%s] 未能抓取到有效网盘链接

What it means

After fanning out concurrent detail-page fetches, searchImpl found that none of the matched items yielded a valid netdisk link. It aggregates results and errors out if the final list is empty. Indicates the detail pages existed but contained no extractable pan links.

Solutions

  1. Check individual detail fetch failures — enable logging in fetchDetailData to see whether fetches failed or extraction found nothing.
  2. Update detail-page extraction selectors to match current site HTML.
  3. Verify requests aren't blocked (add cookies/UA rotation if the site challenges bots).
  4. Try a different keyword that matches posts known to contain links.

Example fix

// before
if len(results) == 0 {
    return nil, fmt.Errorf("[%s] 未能抓取到有效网盘链接", p.Name())
}
// after
if len(results) == 0 {
    return nil, fmt.Errorf("[%s] 未能抓取到有效网盘链接 (items=%d)", p.Name(), len(items))
}
Defensive patterns

Strategy: fallback

Try / catch

results, err := mizixingSearch(ctx, keyword)
if err != nil {
    log.Printf("mizixing: %v", err)
    return otherPluginSearch(ctx, keyword)
}

Prevention

When it happens

Trigger: All detail-page goroutines fail (network/selector mismatch) or succeed but extract no cloud-drive URLs, leaving results empty after wg.Wait().

Common situations: Site changed detail-page HTML so link extraction selectors no longer match; posts without pan links; detail fetches blocked by anti-bot measures (403/timeout).

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at plugin/mizixing/mizixing.go:159

				UniqueID: buildUniqueID(item.URL),
				Title:    item.Title,
				Content:  strings.TrimSpace(content),
				Links:    detail.links,
				Tags:     mergeTags(item.Category, detail.tags),
				Channel:  "",
				Datetime: detail.datetime,
			}

			resultM.Lock()
			results = append(results, result)
			resultM.Unlock()
		}()
	}

	wg.Wait()

	if len(results) == 0 {
		return nil, fmt.Errorf("[%s] 未能抓取到有效网盘链接", p.Name())
	}

	return plugin.FilterResultsByKeyword(results, searchKeyword), nil
}

type searchItem struct {
	Title    string
	URL      string
	Category string
	Summary  string
}

func (p *MizixingPlugin) fetchSearchResults(client *http.Client, keyword string) ([]searchItem, error) {
	searchURL := fmt.Sprintf("%s?s=%s", searchEndpoint, url.QueryEscape(keyword))

	ctx, cancel := context.WithTimeout(context.Background(), requestTimeout)
	defer cancel()

View on GitHub (pinned to beaa561337)