Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2814a23874 | |||
| 3a48a5d667 | |||
| 5cb53dff3b | |||
| b3258662f6 | |||
|
1765813f08
|
|||
|
c11fbf88db
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018-present TaurusXin and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -66,7 +66,7 @@ ncmdump-go -d source_dir -o output_dir -r
|
||||
使用 go module 下载 ncmdump-go 包
|
||||
|
||||
```shell
|
||||
go get -u github.com/taurusxin/ncmdump-go
|
||||
go get -u git.taurusxin.com/taurusxin/ncmdump-go
|
||||
```
|
||||
|
||||
导入并使用
|
||||
@@ -76,7 +76,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/taurusxin/ncmdump-go/ncmcrypt"
|
||||
"git.taurusxin.com/taurusxin/ncmdump-go/ncmcrypt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
12
build.sh
12
build.sh
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERSION=1.7.1
|
||||
VERSION=1.7.3
|
||||
|
||||
# Clean up the build directory
|
||||
rm -rf build
|
||||
@@ -8,30 +8,30 @@ mkdir build
|
||||
|
||||
# Linux amd64
|
||||
echo "Building for Linux amd64..."
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go git.taurusxin.com/taurusxin/ncmdump-go
|
||||
tar zcf build/ncmdump-go_linux_amd64_$VERSION.tar.gz -C build ncmdump-go
|
||||
rm build/ncmdump-go
|
||||
|
||||
# Linux arm64
|
||||
echo "Building for Linux arm64..."
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-w -s" -o build/ncmdump-go git.taurusxin.com/taurusxin/ncmdump-go
|
||||
tar zcf build/ncmdump-go_linux_arm64_$VERSION.tar.gz -C build ncmdump-go
|
||||
rm build/ncmdump-go
|
||||
|
||||
# macOS amd64
|
||||
echo "Building for macOS amd64..."
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go git.taurusxin.com/taurusxin/ncmdump-go
|
||||
tar zcf build/ncmdump-go_darwin_amd64_$VERSION.tar.gz -C build ncmdump-go
|
||||
rm build/ncmdump-go
|
||||
|
||||
# macOS arm64
|
||||
echo "Building for macOS arm64..."
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-w -s" -o build/ncmdump-go github.com/taurusxin/ncmdump-go
|
||||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-w -s" -o build/ncmdump-go git.taurusxin.com/taurusxin/ncmdump-go
|
||||
tar zcf build/ncmdump-go_darwin_arm64_$VERSION.tar.gz -C build ncmdump-go
|
||||
rm build/ncmdump-go
|
||||
|
||||
# Windows amd64
|
||||
echo "Building for Windows amd64..."
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go.exe github.com/taurusxin/ncmdump-go
|
||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-w -s" -o build/ncmdump-go.exe git.taurusxin.com/taurusxin/ncmdump-go
|
||||
zip -q -j build/ncmdump-go_windows_amd64_$VERSION.zip ./build/ncmdump-go.exe
|
||||
rm build/ncmdump-go.exe
|
||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
||||
module github.com/taurusxin/ncmdump-go
|
||||
module git.taurusxin.com/taurusxin/ncmdump-go
|
||||
|
||||
go 1.23.0
|
||||
|
||||
|
||||
6
main.go
6
main.go
@@ -2,8 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/taurusxin/ncmdump-go/ncmcrypt"
|
||||
"github.com/taurusxin/ncmdump-go/utils"
|
||||
"git.taurusxin.com/taurusxin/ncmdump-go/ncmcrypt"
|
||||
"git.taurusxin.com/taurusxin/ncmdump-go/utils"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -59,7 +59,7 @@ func main() {
|
||||
}
|
||||
|
||||
if *showVersion {
|
||||
fmt.Println("ncmdump version 1.7.1")
|
||||
fmt.Println("ncmdump version 1.7.3")
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/go-flac/flacpicture"
|
||||
"github.com/go-flac/flacvorbis"
|
||||
"github.com/go-flac/go-flac"
|
||||
"github.com/taurusxin/ncmdump-go/utils"
|
||||
"git.taurusxin.com/taurusxin/ncmdump-go/utils"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -235,9 +235,15 @@ func (ncm *NeteaseCloudMusic) FixMetadata(fetchAlbumImageFromRemote bool) (bool,
|
||||
cmts = flacvorbis.New()
|
||||
}
|
||||
|
||||
_ = cmts.Add(flacvorbis.FIELD_TITLE, ncm.mMetadata.mName)
|
||||
_ = cmts.Add(flacvorbis.FIELD_ARTIST, ncm.mMetadata.mArtist)
|
||||
_ = cmts.Add(flacvorbis.FIELD_ALBUM, ncm.mMetadata.mAlbum)
|
||||
if res, _ := cmts.Get(flacvorbis.FIELD_TITLE); res[0] != ncm.mMetadata.mName {
|
||||
_ = cmts.Add(flacvorbis.FIELD_TITLE, ncm.mMetadata.mName)
|
||||
}
|
||||
if res, _ := cmts.Get(flacvorbis.FIELD_ARTIST); res[0] != ncm.mMetadata.mArtist {
|
||||
_ = cmts.Add(flacvorbis.FIELD_ARTIST, ncm.mMetadata.mArtist)
|
||||
}
|
||||
if res, _ := cmts.Get(flacvorbis.FIELD_ALBUM); res[0] != ncm.mMetadata.mAlbum {
|
||||
_ = cmts.Add(flacvorbis.FIELD_ALBUM, ncm.mMetadata.mAlbum)
|
||||
}
|
||||
|
||||
cmtsmeta := cmts.Marshal()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user