Skip to content

Commit

Permalink
fix: sing-box sub crawl
Browse files Browse the repository at this point in the history
  • Loading branch information
snakem982 committed Dec 20, 2024
1 parent 9f8e902 commit 9c747fe
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions backend/spider/singbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/metacubex/mihomo/common/convert"
"github.com/metacubex/mihomo/log"
"pandora-box/backend/constant"
"strings"
"sync"
)

Expand All @@ -22,15 +21,9 @@ func (c *SingBox) Get() []map[string]any {

all := GetBytes(c.Url, c.Headers)
if all != nil {
builder := strings.Builder{}
for _, link := range grepShareLink(all) {
builder.WriteString(link + "\n")
}
if builder.Len() > 0 {
sing, err := convert.ConvertsSingBox([]byte(builder.String()))
if err == nil && sing != nil {
proxies = sing
}
sing, err := convert.ConvertsSingBox(all)
if err == nil && sing != nil {
proxies = sing
}
}

Expand Down

0 comments on commit 9c747fe

Please sign in to comment.