mirror of
https://github.com/FloatTech/zbpdata.git
synced 2026-02-17 04:27:58 +09:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e64e7cf82 | ||
|
|
c484316a63 | ||
|
|
5b3008d944 | ||
|
|
541c1dec93 | ||
|
|
c6698663d2 | ||
|
|
dc8f73dee4 | ||
|
|
0d0fa3f435 | ||
|
|
5a511a6d63 | ||
|
|
d15c4b8a09 | ||
|
|
095ee1ae8e | ||
|
|
d640b5f0f1 | ||
|
|
b9848c9a4e | ||
|
|
e2a91d6160 | ||
|
|
4506005ebc | ||
|
|
e4004f113a | ||
|
|
5e0fa81c3b | ||
|
|
bf1d7271ac | ||
|
|
00088d0e74 | ||
|
|
ce8bb59593 | ||
|
|
63d476164f | ||
|
|
9a6fff9f0a | ||
|
|
0fb2e11a61 | ||
|
|
656b7a3045 | ||
|
|
3343ea57f4 | ||
|
|
e8d06b150b | ||
|
|
485fc2618e | ||
|
|
e3cfc94e84 | ||
|
|
215a217867 | ||
|
|
8920298a4f | ||
|
|
9532f04a1a | ||
|
|
3585b946c3 | ||
|
|
4bafa3eb68 | ||
|
|
7bc1828db5 | ||
|
|
c066abebe7 | ||
|
|
aa8f7eb30a |
29
.github/workflows/ci.yml
vendored
Normal file
29
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: CI
|
||||
on: [ push, pull_request ]
|
||||
jobs:
|
||||
golangci:
|
||||
name: CI
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@master
|
||||
with:
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
submodules: 'true'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Check
|
||||
run: |
|
||||
echo "ls ./"
|
||||
ls
|
||||
rm -rf Wife/*.go Wife/*.md Wife/.git
|
||||
echo "ls Wife/"
|
||||
ls Wife/
|
||||
go mod init updater
|
||||
sed -i '1,3d' main.go
|
||||
go mod tidy
|
||||
go run main.go -c
|
||||
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -11,18 +11,23 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
submodules: 'true'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.17'
|
||||
go-version: '1.20'
|
||||
|
||||
- name: Run Updater
|
||||
env:
|
||||
REILIA_SPS: ${{ secrets.REILIA_SPS }}
|
||||
run: |
|
||||
echo "ls ./"
|
||||
ls
|
||||
rm -rf Wife/*.go Wife/*.md Wife/.git
|
||||
echo "ls Wife/"
|
||||
ls Wife/
|
||||
go mod init updater
|
||||
sed -i '1,3d' main.go
|
||||
go mod tidy
|
||||
|
||||
24
.gitignore
vendored
24
.gitignore
vendored
@@ -1,22 +1,6 @@
|
||||
SetuTime/cache
|
||||
control
|
||||
SetuTime/search
|
||||
manager
|
||||
acgimage
|
||||
saucenao
|
||||
Fortune/cache
|
||||
hs
|
||||
nsetu
|
||||
nwife
|
||||
sleep
|
||||
score
|
||||
danbooru
|
||||
gif
|
||||
pixiv
|
||||
scale
|
||||
cache
|
||||
/SetuTime/search
|
||||
/VtbQuotation/store
|
||||
.DS_Store
|
||||
.vscode
|
||||
MockingBird/cache
|
||||
driftbottle
|
||||
job
|
||||
hyaku
|
||||
/[a-z]*
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "Wife"]
|
||||
path = Wife
|
||||
url = https://github.com/FloatTech/zbpwife
|
||||
349046
Chat/dict.txt
Normal file
349046
Chat/dict.txt
Normal file
File diff suppressed because it is too large
Load Diff
37822
Chat/simai.yml
Normal file
37822
Chat/simai.yml
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 818 KiB After Width: | Height: | Size: 555 KiB |
BIN
Diana/text.db
BIN
Diana/text.db
Binary file not shown.
BIN
Dish/dishes.db
Normal file
BIN
Dish/dishes.db
Normal file
Binary file not shown.
BIN
Font/BaotuXiaobaiTi.ttf
Normal file
BIN
Font/BaotuXiaobaiTi.ttf
Normal file
Binary file not shown.
BIN
Font/GlowSansSC-Normal-ExtraBold.ttf
Normal file
BIN
Font/GlowSansSC-Normal-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
Font/Gugi-Regular.ttf
Normal file
BIN
Font/Gugi-Regular.ttf
Normal file
Binary file not shown.
BIN
Font/HachiMaruPop-Regular.ttf
Normal file
BIN
Font/HachiMaruPop-Regular.ttf
Normal file
Binary file not shown.
BIN
Font/Impact.ttf
Normal file
BIN
Font/Impact.ttf
Normal file
Binary file not shown.
BIN
Font/MaokenZhuyuanTi.ttf
Normal file
BIN
Font/MaokenZhuyuanTi.ttf
Normal file
Binary file not shown.
BIN
Font/QiantuXiaotuTi.ttf
Normal file
BIN
Font/QiantuXiaotuTi.ttf
Normal file
Binary file not shown.
BIN
Fortune/Hololive.zip
Normal file
BIN
Fortune/Hololive.zip
Normal file
Binary file not shown.
BIN
Fortune/原神.zip
BIN
Fortune/原神.zip
Binary file not shown.
BIN
Heisi/baisi.bin
Normal file
BIN
Heisi/baisi.bin
Normal file
Binary file not shown.
6314
Heisi/baisi.txt
6314
Heisi/baisi.txt
File diff suppressed because it is too large
Load Diff
BIN
Heisi/heisi.bin
Normal file
BIN
Heisi/heisi.bin
Normal file
Binary file not shown.
19448
Heisi/heisi.txt
19448
Heisi/heisi.txt
File diff suppressed because it is too large
Load Diff
BIN
Heisi/jk.bin
Normal file
BIN
Heisi/jk.bin
Normal file
Binary file not shown.
1939
Heisi/jk.txt
1939
Heisi/jk.txt
File diff suppressed because it is too large
Load Diff
BIN
Heisi/jur.bin
Normal file
BIN
Heisi/jur.bin
Normal file
Binary file not shown.
2972
Heisi/jur.txt
2972
Heisi/jur.txt
File diff suppressed because it is too large
Load Diff
BIN
Heisi/mcn.bin
Normal file
BIN
Heisi/mcn.bin
Normal file
Binary file not shown.
11139
Heisi/mcn.txt
11139
Heisi/mcn.txt
File diff suppressed because it is too large
Load Diff
113
Heisi/migrate/migrate.go
Normal file
113
Heisi/migrate/migrate.go
Normal file
@@ -0,0 +1,113 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type item [10]byte
|
||||
|
||||
func main() {
|
||||
if len(os.Args) != 3 {
|
||||
fmt.Println("Usage: heisi.txt heisi.bin")
|
||||
return
|
||||
}
|
||||
inf, err := os.Open(os.Args[1])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer inf.Close()
|
||||
ouf, err := os.Create(os.Args[2])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ouf.Close()
|
||||
s := bufio.NewScanner(inf)
|
||||
i := 0
|
||||
for s.Scan() {
|
||||
i++
|
||||
t := s.Text()
|
||||
if !strings.HasPrefix(t, "http://hs.heisiwu.com/wp-content/uploads/") {
|
||||
panic("line " + strconv.Itoa(i) + ": invalid url prefix")
|
||||
}
|
||||
t = t[41:]
|
||||
if len(t) < 27 {
|
||||
panic("line " + strconv.Itoa(i) + ": invalid url suffix")
|
||||
}
|
||||
year, err := strconv.Atoi(t[:4]) // 4bits
|
||||
if err != nil {
|
||||
panic("line " + strconv.Itoa(i) + ": " + err.Error())
|
||||
}
|
||||
if year < 2021 {
|
||||
panic("line " + strconv.Itoa(i) + ": invalid year")
|
||||
}
|
||||
mounth, err := strconv.Atoi(t[5:7]) // 4bits
|
||||
if err != nil {
|
||||
panic("line " + strconv.Itoa(i) + ": " + err.Error())
|
||||
}
|
||||
if mounth == 0 || mounth > 12 {
|
||||
panic("line " + strconv.Itoa(i) + ": invalid mounth")
|
||||
}
|
||||
var it item
|
||||
it[0] = byte((year-2021)<<4) | byte(mounth&0x0f) // 1byte
|
||||
if year == 2021 {
|
||||
num, err := strconv.Atoi(t[16 : 16+6]) // 4bytes
|
||||
if err != nil {
|
||||
panic("line " + strconv.Itoa(i) + ": " + err.Error())
|
||||
}
|
||||
d, err := hex.DecodeString(t[28 : 28+8]) // 4bytes
|
||||
if err != nil {
|
||||
panic("line " + strconv.Itoa(i) + ": " + err.Error())
|
||||
}
|
||||
if len(d) != 4 {
|
||||
panic("line " + strconv.Itoa(i) + ": invalid data")
|
||||
}
|
||||
binary.BigEndian.PutUint32(it[1:], uint32(num))
|
||||
copy(it[5:], d)
|
||||
} else {
|
||||
head := "0"
|
||||
if strings.Contains(t[23:], ".png") {
|
||||
head = "1"
|
||||
} else if strings.Contains(t[23:], ".webp") {
|
||||
head = "2"
|
||||
}
|
||||
d, err := hex.DecodeString(head + t[8:8+15]) // 8bytes
|
||||
if err != nil {
|
||||
panic("line " + strconv.Itoa(i) + ": " + err.Error())
|
||||
}
|
||||
if len(d) != 8 {
|
||||
panic("line " + strconv.Itoa(i) + ": invalid data")
|
||||
}
|
||||
copy(it[1:], d)
|
||||
if strings.Contains(t[23:], "scaled") {
|
||||
it[9] = 0x80
|
||||
}
|
||||
if t[23] == '-' && t[24] != 's' {
|
||||
switch {
|
||||
case t[25] == '-' || t[25] == '.':
|
||||
it[9] |= (t[24] - '0') & 0x7f
|
||||
case t[26] == '-' || t[26] == '.':
|
||||
num, err := strconv.Atoi(t[24:26]) // 1byte
|
||||
if err != nil {
|
||||
panic("line " + strconv.Itoa(i) + ": " + err.Error())
|
||||
}
|
||||
it[9] |= byte(num) & 0x7f
|
||||
case t[27] == '-' || t[27] == '.':
|
||||
num, err := strconv.Atoi(t[24:27]) // 1byte
|
||||
if err != nil {
|
||||
panic("line " + strconv.Itoa(i) + ": " + err.Error())
|
||||
}
|
||||
it[9] |= byte(num) & 0x7f
|
||||
default:
|
||||
panic("line " + strconv.Itoa(i) + ": invalid num")
|
||||
}
|
||||
}
|
||||
}
|
||||
ouf.Write(it[:])
|
||||
}
|
||||
}
|
||||
78
Heisi/validate/validate.go
Normal file
78
Heisi/validate/validate.go
Normal file
@@ -0,0 +1,78 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/binary"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"math/bits"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type item [10]byte
|
||||
|
||||
const (
|
||||
template2021 = "http://hs.heisiwu.com/wp-content/uploads/%4d/%02d/%4d%02d16%06d-611a3%8s.jpg"
|
||||
templategeneral = "http://hs.heisiwu.com/wp-content/uploads/%4d/%02d/%015x"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) != 3 {
|
||||
fmt.Println("Usage: heisi.txt heisi.bin")
|
||||
return
|
||||
}
|
||||
inf, err := os.Open(os.Args[1])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer inf.Close()
|
||||
ouf, err := os.Open(os.Args[2])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ouf.Close()
|
||||
s := bufio.NewScanner(inf)
|
||||
i := 0
|
||||
for s.Scan() {
|
||||
i++
|
||||
t := s.Text()
|
||||
var it item
|
||||
ouf.Read(it[:])
|
||||
year, month := int((it[0]>>4)&0x0f), int(it[0]&0x0f)
|
||||
year += 2021
|
||||
if year == 2021 {
|
||||
num := binary.BigEndian.Uint32(it[1:5])
|
||||
dstr := hex.EncodeToString(it[5:9])
|
||||
trestore := fmt.Sprintf(template2021, year, month, year, month, num, dstr)
|
||||
if trestore != t {
|
||||
panic("line " + strconv.Itoa(i) + ": mismatched content " + trestore)
|
||||
}
|
||||
continue
|
||||
}
|
||||
d := binary.BigEndian.Uint64(it[1:9])
|
||||
isscaled := it[9]&0x80 > 0
|
||||
num := int(it[9] & 0x7f)
|
||||
trestore := fmt.Sprintf(templategeneral, year, month, d&0x0fffffff_ffffffff)
|
||||
if num > 0 {
|
||||
trestore += fmt.Sprintf("-%d", num)
|
||||
}
|
||||
if isscaled {
|
||||
trestore += "-scaled"
|
||||
}
|
||||
d = bits.RotateLeft64(d, 4) & 0x0f
|
||||
switch d {
|
||||
case 0:
|
||||
trestore += ".jpg"
|
||||
case 1:
|
||||
trestore += ".png"
|
||||
case 2:
|
||||
trestore += ".webp"
|
||||
default:
|
||||
panic("line " + strconv.Itoa(i) + ": invalid ext")
|
||||
}
|
||||
if trestore != t {
|
||||
panic("line " + strconv.Itoa(i) + ": mismatched content " + trestore)
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Heisi/zuk.bin
Normal file
BIN
Heisi/zuk.bin
Normal file
Binary file not shown.
3621
Heisi/zuk.txt
3621
Heisi/zuk.txt
File diff suppressed because it is too large
Load Diff
BIN
Hitokoto/hitokoto.db
Normal file
BIN
Hitokoto/hitokoto.db
Normal file
Binary file not shown.
BIN
Jptingroom/item.db
Normal file
BIN
Jptingroom/item.db
Normal file
Binary file not shown.
Binary file not shown.
1
Wife
Submodule
1
Wife
Submodule
Submodule Wife added at dc5f637a4c
BIN
Ymgal/ymgal.db
BIN
Ymgal/ymgal.db
Binary file not shown.
29
main.go
29
main.go
@@ -6,6 +6,7 @@ package main
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"os"
|
||||
@@ -13,11 +14,28 @@ import (
|
||||
"unicode"
|
||||
"unsafe"
|
||||
|
||||
"github.com/FloatTech/floatbox/process"
|
||||
"github.com/fumiama/go-registry"
|
||||
"github.com/wdvxdr1123/ZeroBot/utils/helper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c := flag.Bool("c", false, "check repo only")
|
||||
flag.Parse()
|
||||
es, err := fs.ReadDir(os.DirFS("./"), ".")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, es := range es {
|
||||
if es.IsDir() && es.Name()[0] != '.' {
|
||||
if !unicode.IsUpper([]rune(es.Name())[0]) {
|
||||
panic("failed: 文件夹 " + es.Name() + " 首字母必须为大写")
|
||||
}
|
||||
}
|
||||
}
|
||||
if *c {
|
||||
return
|
||||
}
|
||||
var files []string
|
||||
fs.WalkDir(os.DirFS("./"), ".", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
@@ -39,24 +57,25 @@ func main() {
|
||||
*(*unsafe.Pointer)(unsafe.Pointer(&md5s[i])) = unsafe.Pointer(&buf)
|
||||
*(*uintptr)(unsafe.Add(unsafe.Pointer(&md5s[i]), unsafe.Sizeof(uintptr(0)))) = uintptr(16)
|
||||
}
|
||||
r := registry.NewRegedit("reilia.fumiama.top:32664", "fumiama", os.Getenv("REILIA_SPS"))
|
||||
err := r.Connect()
|
||||
r := registry.NewRegedit("reilia.fumiama.top:32664", "", "fumiama", os.Getenv("REILIA_SPS"))
|
||||
err = r.Connect()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for i, fn := range files {
|
||||
for c := 0; c < 5; c++ {
|
||||
for c := 0; c < 16; c++ {
|
||||
err = r.Set("data/"+fn, md5s[i])
|
||||
fmt.Println("set", "data/"+fn, "=", hex.EncodeToString(helper.StringToBytes(md5s[i])))
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
if c >= 4 {
|
||||
panic("ERROR:" + err.Error() + "max retry times exceeded")
|
||||
if c >= 15 {
|
||||
panic("ERROR:" + err.Error() + ", max retry times exceeded")
|
||||
} else {
|
||||
fmt.Println("ERROR:", err, ", retry times:", c)
|
||||
}
|
||||
_ = r.Close()
|
||||
process.SleepAbout1sTo2s()
|
||||
err = r.Connect()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user