OwenTruong / civitdl

A CLI python script to batch download models from CivitAI with CivitAI Api V1
Apache License 2.0
46 stars 6 forks source link

bug(dl): model title from civitai with special character "/" creates nested directories #56

Closed OwenTruong closed 7 months ago

OwenTruong commented 8 months ago

What happened?

When a model's name contains slashes, it creates nested directory based on that name.

This specific model causes an issue:

Steps to reproduce the behavior

Run civitdl 18561 ./test/models/test2

Actual Behavior

Download completed for "Anything / Kl-f8-anime2 / Vae-ft-mse-840000-ema-pruned / Blessed / ClearVAE (fp16/cleaned)" 
            - Model ID: 118561
            - Version ID: 131654
            - Path: ./test/models/test2/Anything / Kl-f8-anime2 / Vae-ft-mse-840000-ema-pruned / Blessed / ClearVAE (fp16/cleaned)/anythingKlF8Anime2VaeFtMse840000_klF8Anime2-mid_118561-vid_131654.safetensors

Expected Behavior

Download completed for "Anything / Kl-f8-anime2 / Vae-ft-mse-840000-ema-pruned / Blessed / ClearVAE (fp16/cleaned)" 
            - Model ID: 118561
            - Version ID: 131654
            - Path: ./test/models/test2/model-title/anythingKlF8Anime2VaeFtMse840000_klF8Anime2-mid_118561-vid_131654.safetensors

System Detail

Additional Context

Currently it is impacting v2 of development. Not sure if it is also impacting v1.