sca255 commited on
Commit
5dfbeea
1 Parent(s): bfb7572

Create dl.py

Browse files
Files changed (1) hide show
  1. dl.py +18 -0
dl.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests as rq
2
+ import json
3
+ import os
4
+ tkn=os.getenv("token_civit")
5
+ opt=rq.get("https://civitai.com/api/v1/model-versions/by-hash/F32CC1F1")
6
+ j:dict=opt.json()
7
+ opt =rq.get(j.get("files")[0].get("downloadUrl")+"?token="+tkn)
8
+ print("0 of 2")
9
+ #print(opt)
10
+ with open("/home/user/app/fastsdcpu/calicomix.safetensors","wb") as f:
11
+ f.write(opt.content)
12
+ opt=rq.get("https://civitai.com/api/v1/model-versions/by-hash/B56CE717")
13
+ j:dict=opt.json()
14
+ opt =rq.get(j.get("files")[0].get("downloadUrl"))
15
+ print("1 of 2")
16
+ with open("/home/user/app/fastsdcpu/mienamix.safetensors","wb") as f:
17
+ f.write(opt.content)
18
+ print("2 of 2")