mirror of
https://git.um-react.app/um/cli.git
synced 2025-11-28 03:33:02 +00:00
chore: rename project namespace
This commit is contained in:
@@ -22,7 +22,7 @@ Original: Web Edition https://git.unlock-music.dev/um/web
|
|||||||
|
|
||||||
- Requirements: **Golang 1.23.3**
|
- Requirements: **Golang 1.23.3**
|
||||||
|
|
||||||
1. run `go install unlock-music.dev/cli/cmd/um@master`
|
1. run `go install git.um-react.app/um/cli/cmd/um@master`
|
||||||
|
|
||||||
### Build from repo source
|
### Build from repo source
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"git.um-react.app/um/cli/internal/utils"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"unlock-music.dev/cli/internal/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type QMCKeys map[string]string
|
type QMCKeys map[string]string
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"unlock-music.dev/cli/internal/sniff"
|
"git.um-react.app/um/cli/internal/sniff"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RawDecoder struct {
|
type RawDecoder struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Decoder struct {
|
type Decoder struct {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// kgmCryptoV3 is kgm file crypto v3
|
// kgmCryptoV3 is kgm file crypto v3
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package kgm
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
"unlock-music.dev/cli/algo/kgm/pc_kugou_db"
|
"git.um-react.app/um/cli/algo/kgm/pc_kugou_db"
|
||||||
"unlock-music.dev/cli/algo/qmc"
|
"git.um-react.app/um/cli/algo/qmc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newKgmCryptoV5(header *header, kggDatabasePath string) (common.StreamDecoder, error) {
|
func newKgmCryptoV5(header *header, kggDatabasePath string) (common.StreamDecoder, error) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
const magicHeader1 = "yeelion-kuwo-tme"
|
const magicHeader1 = "yeelion-kuwo-tme"
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package ncm
|
package ncm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go.uber.org/zap"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
|
"git.um-react.app/um/cli/algo/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ncmMeta interface {
|
type ncmMeta interface {
|
||||||
@@ -43,7 +44,6 @@ func (m *ncmMetaMusic) GetAlbumImageURL() string {
|
|||||||
return m.AlbumPic
|
return m.AlbumPic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (m *ncmMetaMusic) GetArtists() []string {
|
func (m *ncmMetaMusic) GetArtists() []string {
|
||||||
m.logger.Debug("ncm artists raw", zap.Any("artists", m.Artist))
|
m.logger.Debug("ncm artists raw", zap.Any("artists", m.Artist))
|
||||||
var artists []string
|
var artists []string
|
||||||
|
|||||||
@@ -8,13 +8,14 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go.uber.org/zap"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"go.uber.org/zap"
|
||||||
"unlock-music.dev/cli/internal/utils"
|
|
||||||
|
"git.um-react.app/um/cli/algo/common"
|
||||||
|
"git.um-react.app/um/cli/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const magicHeader = "CTENFDAM"
|
const magicHeader = "CTENFDAM"
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"git.um-react.app/um/cli/algo/common"
|
||||||
|
"git.um-react.app/um/cli/internal/utils"
|
||||||
go_mmkv "github.com/unlock-music/go-mmkv"
|
go_mmkv "github.com/unlock-music/go-mmkv"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"unlock-music.dev/cli/algo/common"
|
|
||||||
"unlock-music.dev/cli/internal/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func mergeMMKVKeys(keys ...common.QMCKeys) common.QMCKeys {
|
func mergeMMKVKeys(keys ...common.QMCKeys) common.QMCKeys {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
"git.um-react.app/um/cli/algo/common"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"unlock-music.dev/cli/algo/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func LoadMMKVOrDefault(path string, key string, logger *zap.Logger) (result common.QMCKeys, err error) {
|
func LoadMMKVOrDefault(path string, key string, logger *zap.Logger) (result common.QMCKeys, err error) {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
package qmc
|
package qmc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.um-react.app/um/cli/algo/common"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"unlock-music.dev/cli/algo/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func LoadMMKVOrDefault(path string, key string, logger *zap.Logger) (result common.QMCKeys, err error) {
|
func LoadMMKVOrDefault(path string, key string, logger *zap.Logger) (result common.QMCKeys, err error) {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
"unlock-music.dev/cli/internal/sniff"
|
"git.um-react.app/um/cli/internal/sniff"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Decoder struct {
|
type Decoder struct {
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
"unlock-music.dev/cli/algo/qmc/client"
|
"git.um-react.app/um/cli/algo/qmc/client"
|
||||||
"unlock-music.dev/cli/internal/ffmpeg"
|
"git.um-react.app/um/cli/internal/ffmpeg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (d *Decoder) GetAudioMeta(ctx context.Context) (common.AudioMeta, error) {
|
func (d *Decoder) GetAudioMeta(ctx context.Context) (common.AudioMeta, error) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func loadTestDataQmcDecoder(filename string) ([]byte, []byte, error) {
|
func loadTestDataQmcDecoder(filename string) ([]byte, []byte, error) {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
"unlock-music.dev/cli/internal/sniff"
|
"git.um-react.app/um/cli/internal/sniff"
|
||||||
)
|
)
|
||||||
|
|
||||||
var replaceHeader = []byte{0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70}
|
var replaceHeader = []byte{0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"git.um-react.app/um/cli/algo/common"
|
||||||
"unlock-music.dev/cli/internal/sniff"
|
"git.um-react.app/um/cli/internal/sniff"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Decoder struct {
|
type Decoder struct {
|
||||||
|
|||||||
@@ -15,21 +15,21 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.um-react.app/um/cli/algo/common"
|
||||||
|
_ "git.um-react.app/um/cli/algo/kgm"
|
||||||
|
_ "git.um-react.app/um/cli/algo/kwm"
|
||||||
|
_ "git.um-react.app/um/cli/algo/ncm"
|
||||||
|
"git.um-react.app/um/cli/algo/qmc"
|
||||||
|
_ "git.um-react.app/um/cli/algo/tm"
|
||||||
|
_ "git.um-react.app/um/cli/algo/xiami"
|
||||||
|
_ "git.um-react.app/um/cli/algo/ximalaya"
|
||||||
|
"git.um-react.app/um/cli/internal/ffmpeg"
|
||||||
|
"git.um-react.app/um/cli/internal/sniff"
|
||||||
|
"git.um-react.app/um/cli/internal/utils"
|
||||||
"github.com/fsnotify/fsnotify"
|
"github.com/fsnotify/fsnotify"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
"unlock-music.dev/cli/algo/common"
|
|
||||||
_ "unlock-music.dev/cli/algo/kgm"
|
|
||||||
_ "unlock-music.dev/cli/algo/kwm"
|
|
||||||
_ "unlock-music.dev/cli/algo/ncm"
|
|
||||||
"unlock-music.dev/cli/algo/qmc"
|
|
||||||
_ "unlock-music.dev/cli/algo/tm"
|
|
||||||
_ "unlock-music.dev/cli/algo/xiami"
|
|
||||||
_ "unlock-music.dev/cli/algo/ximalaya"
|
|
||||||
"unlock-music.dev/cli/internal/ffmpeg"
|
|
||||||
"unlock-music.dev/cli/internal/sniff"
|
|
||||||
"unlock-music.dev/cli/internal/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var AppVersion = "custom"
|
var AppVersion = "custom"
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
|||||||
module unlock-music.dev/cli
|
module git.um-react.app/um/cli
|
||||||
|
|
||||||
go 1.25.1
|
go 1.25.1
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,15 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go.uber.org/zap"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"unlock-music.dev/cli/algo/common"
|
"go.uber.org/zap"
|
||||||
"unlock-music.dev/cli/internal/utils"
|
|
||||||
|
"git.um-react.app/um/cli/algo/common"
|
||||||
|
"git.um-react.app/um/cli/internal/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExtractAlbumArt(ctx context.Context, rd io.Reader) (*bytes.Buffer, error) {
|
func ExtractAlbumArt(ctx context.Context, rd io.Reader) (*bytes.Buffer, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user