Confuzu / CivitAI-Model-grabber

The Script Downloads in bulk both model(Lora,Lycoris,Embeding etc..) and related images, from a given CivitAI Username
GNU General Public License v3.0
18 stars 4 forks source link

UnboundLocalError: local variable 'file_name' referenced before assignment #2

Closed ElRandom78 closed 6 months ago

ElRandom78 commented 7 months ago

Hi Confuzu! Thanks in Advance for your Fantastic Tool! It's amazing :) I'm writing to you because yesterday I tried to download files from Civitai, from user nochekaiser881. The Script has downloaded on the 1° try, a huge amount of files, organizing them in 729 folders, but, unfortunately has not downloaded the complete entirety of the Archive of noche, (his archive count 1473 in total at this moment).

At a certain point, during the download, it has shown this error : Unbound Local Error

Can you fix this please?

Confuzu commented 7 months ago

I will look into it

Confuzu commented 7 months ago

i updated the code i had no problems anymore with downloading the the specific username nochekaiser881. The difference between the archive an the downloads could be come from here: Skip if 'name' or 'downloadUrl' keys are missing

ElRandom78 commented 6 months ago

ok, thanks for your Replky, Sir. But I have noticed another problem with your script on the same user: nochekaiser881. In some cases, for several Loras, your script download safetensor files not usable, because it download some file.safetensors of few kylobytes instead of the canonic weight of 36, 72, MB , ecc... I can't understand why.

I post you an example of a Lora not usable, that I downloaded through the script:

EXAMPLE_LORA_NOT_USABLE

can you take a look at this?

Confuzu commented 6 months ago

i found why some safetensors are only a few kylobytes. CivitAI changed there API so that creator of Assets have the Option to lock there content behind the civitAI login.

"The creator of this asset requires you to be logged in to download it"

I'll see what I can do

Confuzu commented 6 months ago

I added Token auth to the script. it should now download all of them, including those hidden behind the login. Please Try it

Open a new Issues if you found some. Thanks

ElRandom78 commented 6 months ago

OMG, You're Incredible Sir! You have completely solve the problem. With the API KEY TOKEN, the new Script now has successfully downloaded the entire archive. :) thank you, Have a nice Christmas

ElRandom78 commented 6 months ago

no-problem-anime-girl-happy-swaying-53cu4qa1gf3z3b62