MCPcopy Create free account
hub / github.com/FloatTech/AnimeAPI / SignURL

Function SignURL

bilibili/wbi.go:32–49  ·  view source on GitHub ↗

SignURL wbi签名包装 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/misc/sign/wbi.md

(urlStr string)

Source from the content-addressed store, hash-verified

30
31// SignURL wbi签名包装 https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/misc/sign/wbi.md
32func SignURL(urlStr string) string {
33 urlObj, _ := url.Parse(urlStr)
34 imgKey, subKey := getWbiKeysCached()
35 query := urlObj.Query()
36 params := map[string]string{}
37 for k, v := range query {
38 if len(v) > 0 {
39 params[k] = v[0]
40 }
41 }
42 newParams := wbiSign(params, imgKey, subKey)
43 for k, v := range newParams {
44 query.Set(k, v)
45 }
46 urlObj.RawQuery = query.Encode()
47 newURL := urlObj.String()
48 return newURL
49}
50
51func getMixinKey(orig string) string {
52 var str strings.Builder

Callers 1

GetVideoSummaryFunction · 0.85

Calls 4

getWbiKeysCachedFunction · 0.85
wbiSignFunction · 0.85
SetMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…