fish2018/pansou · error

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

Error message

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

What it means

searchImpl fetches candidate posts concurrently and extracts net-disk links from each; if no goroutine produced any valid result, it returns "[jsnoteclub] 未能获取到有效网盘链接" (failed to obtain valid net-disk links).

Solutions

  1. Log per-post extraction errors inside the worker goroutines to see why results are empty
  2. Update the detail-page parsing selectors to the current site HTML
  3. Verify a matched post's detail page manually contains a net-disk link
  4. Add retry/fallback fetch (different UA, cached page) before declaring failure

Example fix

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

// after
wg.Wait()
if len(results) == 0 {
	if lastExtractErr != nil {
		return nil, fmt.Errorf("[%s] 未能获取到有效网盘链接: %w", p.Name(), lastExtractErr)
	}
	return nil, fmt.Errorf("[%s] 未能获取到有效网盘链接", p.Name())
}
Defensive patterns

Strategy: fallback

Try / catch

// Go
results, err := jnc.Search(ctx, keyword, ext)
if err != nil && strings.Contains(err.Error(), "未能获取到有效网盘链接") {
	log.Printf("jsnoteclub: extraction produced nothing (site layout changed?): %v", err)
	// try next plugin
}

Prevention

When it happens

Trigger: wg.Wait() completes and results is empty: every matched post's detail fetch/parse failed or contained no usable pan-link (per-goroutine errors are swallowed by the worker closures).

Common situations: jsnoteclub.com changed its post HTML so the link extractor no longer matches; posts were deleted or links expired; network failures in all detail-page fetches; keyword matched posts that never contained share links.

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

Appendix: source

Thrown at plugin/jsnoteclub/jsnoteclub.go:183

				UniqueID: fmt.Sprintf("%s-%s", p.Name(), post.ID),
				Title:    strings.TrimSpace(post.Title),
				Content:  strings.TrimSpace(post.Excerpt),
				Links:    links,
				Tags:     []string{strings.TrimSpace(post.Slug)},
				Channel:  "",
				Datetime: post.updatedAtTime(),
			}

			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
}

func (p *JsNoteClubPlugin) getAllPosts(client *http.Client) ([]ghostPost, error) {
	now := time.Now()

	postsCache.RLock()
	if len(postsCache.entries) > 0 && now.Before(postsCache.expire) {
		defer postsCache.RUnlock()
		return postsCache.entries, nil
	}
	postsCache.RUnlock()

	postsCache.Lock()
	defer postsCache.Unlock()

View on GitHub (pinned to beaa561337)