MTGDB是用GO編寫的工具來創建和填充數據庫,所有魔術都可以從Scryfall中獲得的收集卡。 MTGDB還下載了每張卡的圖像。
go install github.com/pioz/mtgdb/cmd/mtgdb@latest
mtgdb -h
git clone github.com/pioz/mtgdb
cd mtgdb
# go test
go build -o mtgdb ./cmd/mtgdb/main.go
./mtgdb -h
在使用MTGDB之前,您必須設置2個環境變量(也需要.env
文件工作):
DB_CONNECTION
>數據庫連接字符串(示例user@tcp(127.0.0.1:3306)/mtgdb?charset=utf8mb4&parseTime=True
)DATA_PATH
-->路徑下載諸如卡片圖像之類的資產(示例./data
)您第一次運行MTGDB時,它將遷移到創建表的數據庫。
mtgdb -h
Usage of mtgdb:
-download-concurrency int
Set max download concurrency
-en
Download card images only in EN language (default true)
-f Force re-download of card images
-fsha1
Force re-download of card images, but only if the sha1sum is changed
-ftime
Force re-download of card images, but only if the modified date is older
-h Print this help
-only string
Import some sets (es: -only eld,war)
-p Display progress bar
-skip-assets
Skip download of set and card images
-u Update Scryfall database
如果您有任何問題,請在GitHub或分叉上添加問題並發送拉動請求。
版權(C)2020 Enrico Pilotto(@Pioz)。有關詳細信息,請參見許可證。