fish2018/pansou · error

[ ] 详情解析为空

Error message

[%s] 详情解析为空

What it means

Empty-parse guard in yulinshufa getDetailResult: the detail document parsed successfully but parseDetailDocument returned nil — the expected fields/links were absent (layout change, empty page, or fully filtered content). Treated as a hard error, not an empty result, so nothing is cached.

Solutions

  1. Update parseDetailDocument selectors for the current layout
  2. Treat persistently-empty parses as skip-worthy, not retry-worthy
  3. Optionally cache the nil to avoid re-fetching dead pages
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at plugin/yulinshufa/yulinshufa.go:331 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at plugin/yulinshufa/yulinshufa.go:331

	}
	p.decorateCommonHeaders(req)
	req.Header.Set("Referer", baseURL+"/")
	p.debugf("请求详情: %s", item.DetailURL)

	resp, err := p.doRequestWithRetry(p.detailHTTPClient, req, requestMaxRetries)
	if err != nil {
		return nil, fmt.Errorf("[%s] 请求详情失败: %w", p.Name(), err)
	}
	defer resp.Body.Close()

	doc, err := p.buildGBKDocument(resp.Body)
	if err != nil {
		return nil, fmt.Errorf("[%s] 解析详情失败: %w", p.Name(), err)
	}

	result := p.parseDetailDocument(doc, item)
	if result == nil {
		return nil, fmt.Errorf("[%s] 详情解析为空", p.Name())
	}

	p.storeInCache(cacheKey, *result)
	return result, nil
}

// parseDetailDocument 将详情页转为 SearchResult
func (p *YulinshufaPlugin) parseDetailDocument(doc *goquery.Document, item searchItem) *model.SearchResult {
	contentSel := doc.Find("div.content").First()
	if contentSel.Length() == 0 {
		return nil
	}

	result := model.SearchResult{
		UniqueID:  fmt.Sprintf("%s-%s", p.Name(), item.ID),
		MessageID: fmt.Sprintf("%s-%s", p.Name(), item.ID),
		Channel:   "",
		Title:     item.Title,

View on GitHub (pinned to beaa561337)