Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package service
import (
"91porn-server/common"
"91porn-server/common/crypt"
)
func GetTFUrl(tf string) string {
if tf != "" {
type tfStc struct {
Url string `json:"url"`
Name string `json:"name"`
}
var tfArr []tfStc
_ = crypt.JSON2Struct(tf, &tfArr)
if len(tfArr) == 0 {
return tf
}
weight := 100 / len(tfArr)
chioce := make([]common.Choice, len(tfArr))
for i := range tfArr {
chioce[i] = common.Choice{
Weight: weight,
Item: tfArr[i].Url,
}
}
ch, _ := common.WeightedChoice(chioce)
if v, ok := ch.Item.(string); ok {
return v
}
}
return tf
}