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)。有关详细信息,请参见许可证。