{"record":{"id":"ccff0cd6f0b3dea0","repo":"fish2018/pansou","slug":"root-d-id-d","errorCode":null,"errorMessage":"不支持的网盘类型 root=%d id=%d","messagePattern":"不支持的网盘类型 root=(.+?) id=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugin/yingso/yingso.go","lineNumber":253,"sourceCode":"func (p *YingsoPlugin) resolveItem(ctx context.Context, client *http.Client, config apiConfig, item searchItem) (model.SearchResult, error) {\n\tpayload := getKeyPayload{ID: item.ID, UserID: config.UserID}\n\tencrypted, err := encryptPayload(payload, config)\n\tif err != nil {\n\t\treturn model.SearchResult{}, err\n\t}\n\n\tvar response apiEnvelope[string]\n\tendpoint := fmt.Sprintf(\"%s/%s/getKey\", p.apiBaseURL, url.PathEscape(config.URLVersion))\n\tif err := p.requestJSON(ctx, client, http.MethodPost, endpoint, encrypted, &response); err != nil {\n\t\treturn model.SearchResult{}, err\n\t}\n\tif response.Code != http.StatusOK || strings.TrimSpace(response.Data) == \"\" {\n\t\treturn model.SearchResult{}, fmt.Errorf(\"getKey id=%d code=%d msg=%s\", item.ID, response.Code, response.Msg)\n\t}\n\n\tlinkType, linkURL, password := buildLink(item.Root, response.Data)\n\tif linkURL == \"\" {\n\t\treturn model.SearchResult{}, fmt.Errorf(\"不支持的网盘类型 root=%d id=%d\", item.Root, item.ID)\n\t}\n\n\ttitle := cleanText(item.Title)\n\tif title == \"\" {\n\t\ttitle = fmt.Sprintf(\"影搜资源 %d\", item.ID)\n\t}\n\tid := fmt.Sprintf(\"%s-%d\", pluginName, item.ID)\n\tnow := time.Now()\n\treturn model.SearchResult{\n\t\tMessageID: id,\n\t\tUniqueID:  id,\n\t\tChannel:   \"\",\n\t\tDatetime:  now,\n\t\tTitle:     title,\n\t\tContent:   title,\n\t\tLinks: []model.Link{{\n\t\t\tType:      linkType,\n\t\t\tURL:       linkURL,","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/yingso/yingso.go#L235-L271","documentation":"This error is returned by YingsoPlugin.resolveItem when the netdisk type of a search item — the numeric Root field — does not map to any supported provider in buildLink (only roots 1-5: aliyun, quark, xunlei, baidu, uc), or the constructed share URL fails URL validation. The key was fetched successfully, but the plugin cannot build a link for that cloud-drive type.","triggerScenarios":"getKey succeeded (data non-empty) but item.Root is 0 or any value outside {1,2,3,4,5}, causing buildLink's default branch to return an empty linkURL; alternatively the returned key yields a URL that fails url.Parse / scheme-host validation in buildLink.","commonSituations":"The Yingso API added support for a new cloud-drive provider (new Root value) that this plugin version does not know; items with Root=0 (unknown type) appear in search results; the API returns a malformed or relative key string instead of a share ID/URL.","solutions":["Log item.Root and item.ID, then check buildLink's switch statement: add a case mapping the new root value to the correct type and URL prefix (yingso.go:368-389).","If the API added a new netdisk provider, extend buildLink with the new prefix (e.g. case 6 for a new drive) and rebuild.","If Root=0 means 'unknown', filter such items out in search() before spawning resolveItem goroutines to avoid wasted getKey calls.","If the key string is malformed (URL validation fails), log the raw response.Data to inspect what the API returns and adjust parsing."],"exampleFix":"// before\ncase 5:\n\tlinkType, prefix = \"uc\", \"https://drive.uc.cn/s/\"\ndefault:\n\treturn \"\", \"\", \"\"\n// after\ncase 5:\n\tlinkType, prefix = \"uc\", \"https://drive.uc.cn/s/\"\ncase 6:\n\tlinkType, prefix = \"quark-share\", \"https://pan.quark.cn/s/\"\ndefault:\n\treturn \"\", \"\", \"\"","handlingStrategy":"validation","validationCode":"func isSupportedRoot(root int) bool {\n\tswitch root {\n\tcase 1, 2, 3, 4, 5:\n\t\treturn true\n\t}\n\treturn false\n}\n// filter before resolving:\nitems = slices.DeleteFunc(items, func(it searchItem) bool { return !isSupportedRoot(it.Root) })","typeGuard":"func knownRoot(root int) bool { return root >= 1 && root <= 5 }","tryCatchPattern":"result, err := resolveItem(ctx, client, config, item)\nif err != nil {\n\tif strings.Contains(err.Error(), \"不支持的网盘类型\") {\n\t\tlog.Printf(\"unsupported drive type, skipping id=%v\", err)\n\t\treturn nil\n\t}\n\treturn err\n}","preventionTips":["Filter items by known Root values (1-5) before calling getKey to save API calls.","Update buildLink whenever Yingso adds a new cloud-drive provider.","Log unknown Root values so new types are noticed quickly instead of silently dropped."],"tags":["unsupported-type","mapping","url","netdisk"],"backgroundTag":"unsupported-enum-value","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}