fish2018/pansou · warning

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

Error message

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

What it means

searchImpl fans out over matched threads, extracting netdisk (网盘) links concurrently. If no worker produced a valid link, it returns this error: the search found threads but none contained usable pan links.

Solutions

  1. Update the link-extraction parsing to match the current page markup
  2. Test one thread page manually and compare against the parser's selectors
  3. Check whether the site now requires login/cookies to expose pan links
  4. Verify extraction against recent posts (older posts may genuinely lack pan links)

Example fix

// before
if len(results) == 0 { return nil, fmt.Errorf("no links") }
// after
if len(results) == 0 {
    log.Printf("lou1: %d threads matched but 0 netdisk links (check parser)", len(threads))
    return nil, model.ErrNoValidLinks
}
Defensive patterns

Strategy: fallback

Try / catch

results, err := lou1.Search(kw)
if err != nil && strings.Contains(err.Error(), "未能抓取到有效网盘链接") {
    log.Printf("lou1: threads found but no pan links")
    return tryAlternatePlugins(kw)
}

Prevention

When it happens

Trigger: All fetched thread pages parsed successfully but none yielded a recognized netdisk URL, leaving len(results)==0 after wg.Wait().

Common situations: Threads only contain magnet/torrent links; upstream changed the page markup so the link regex/selector no longer matches; posts are behind login; anti-bot served a stub page.

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/e409df7554976943. Report an issue: GitHub.

Appendix: source

Thrown at plugin/lou1/lou1.go:161

				UniqueID: buildUniqueID(thread.URL),
				Title:    thread.Title,
				Content:  strings.TrimSpace(content),
				Links:    detail.links,
				Tags:     mergeTags(thread.Tags, 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 searchThread struct {
	Title   string
	URL     string
	Tags    []string
	Summary string
}

func (p *Lou1Plugin) fetchSearchResults(client *http.Client, keyword string) ([]searchThread, error) {
	params := url.Values{}
	params.Set("q", keyword)
	params.Set("page", "1")
	params.Set("page_size", fmt.Sprintf("%d", searchLimit))
	searchURL := searchAPIPath + "?" + params.Encode()

View on GitHub (pinned to beaa561337)