更新说明

This commit is contained in:
Silvan 2019-12-18 16:15:26 +08:00
parent 38f987e0ea
commit 1b2c713fdd
7 changed files with 18 additions and 25 deletions

View File

@ -1,12 +1,12 @@
package config
import (
"UnblockNeteaseMusic/utils"
"flag"
"fmt"
"os"
"path/filepath"
"strings"
"UnblockNeteaseMusic/utils"
)
var (
@ -27,18 +27,11 @@ func ValidParams() bool {
fmt.Printf("arg[%d]=%s\n", i, flag.Arg(i))
}
}
//fmt.Println("--------------------Port------------------------")
//fmt.Println("--------------------Source------------------------")
sources := strings.Split(*Source, ":")
if len(sources) < 1 {
fmt.Printf("source param invalid: %v \n", *Source)
return false
}
//for _, p := range sources {
// fmt.Println(p)
//}
currentPath, error := utils.GetCurrentPath()
if error != nil {
fmt.Println(error)

View File

@ -1,8 +1,8 @@
package host
import (
"bufio"
"UnblockNeteaseMusic/config"
"bufio"
"fmt"
"io"
"net"

View File

@ -1,11 +1,11 @@
package network
import (
host2 "UnblockNeteaseMusic/host"
"bytes"
"compress/gzip"
"crypto/tls"
"fmt"
host2 "UnblockNeteaseMusic/host"
"io"
"io/ioutil"
"net"

View File

@ -59,13 +59,13 @@ func AesEncryptECB(origData []byte, key []byte) (encrypted []byte) {
return encrypted
}
func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte,success bool) {
func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte, success bool) {
cipher, _ := aes.NewCipher(generateKey(key))
decrypted = make([]byte, len(encrypted))
//
for bs, be := 0, cipher.BlockSize(); bs < len(encrypted); bs, be = bs+cipher.BlockSize(), be+cipher.BlockSize() {
if be > len(encrypted) {
return encrypted,false
return encrypted, false
}
cipher.Decrypt(decrypted[bs:be], encrypted[bs:be])
}
@ -75,7 +75,7 @@ func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte,success bool)
trim = len(decrypted) - int(decrypted[len(decrypted)-1])
}
return decrypted[:trim],true
return decrypted[:trim], true
}
func generateKey(key []byte) (genKey []byte) {
genKey = make([]byte, 16)

View File

@ -1,6 +1,11 @@
package processor
import (
"UnblockNeteaseMusic/host"
"UnblockNeteaseMusic/network"
"UnblockNeteaseMusic/processor/crypto"
"UnblockNeteaseMusic/provider"
"UnblockNeteaseMusic/utils"
"bufio"
"bytes"
"compress/gzip"
@ -8,16 +13,11 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"UnblockNeteaseMusic/host"
"io"
"io/ioutil"
"net/http"
"UnblockNeteaseMusic/network"
"UnblockNeteaseMusic/processor/crypto"
"UnblockNeteaseMusic/provider"
"regexp"
"strings"
"UnblockNeteaseMusic/utils"
)
var (

View File

@ -1,12 +1,12 @@
package kuwo
import (
"UnblockNeteaseMusic/network"
"UnblockNeteaseMusic/utils"
"fmt"
"net/http"
"net/url"
"UnblockNeteaseMusic/network"
"strings"
"UnblockNeteaseMusic/utils"
)
func SearchSong(key map[string]interface{}) string {

View File

@ -1,20 +1,20 @@
package proxy
import (
"bytes"
"UnblockNeteaseMusic/config"
"UnblockNeteaseMusic/host"
"UnblockNeteaseMusic/network"
"UnblockNeteaseMusic/processor"
"UnblockNeteaseMusic/version"
"bytes"
"crypto/tls"
"fmt"
"UnblockNeteaseMusic/host"
"io"
"net"
"net/http"
"UnblockNeteaseMusic/network"
"UnblockNeteaseMusic/processor"
"strconv"
"strings"
"time"
"UnblockNeteaseMusic/version"
)
type HttpHandler struct{}