Skip to content

Commit 2e76773

Browse files
authored
Added QR Code generating script
1 parent cfb32aa commit 2e76773

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

qrs.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Config
2+
3+
np = 301 # Number of photos
4+
ns = 301 # Number of sketches
5+
6+
7+
# Actual Code
8+
import requests
9+
import json
10+
11+
s = "{:04d}"
12+
13+
for i in range(1,np):
14+
print("Generating QR Code for P" + s.format(i), flush=True)
15+
r = requests.post('https://qr-generator.qrcode.studio/qr/custom', json={"data":"P" + s.format(i) ,"config":{"body":"square","eye":"frame1","eyeBall":"ball0","erf1":["fh"],"erf2":[],"erf3":["fh","fv"],"brf1":[],"brf2":[],"brf3":[],"bodyColor":"#000000","bgColor":"#FFFFFF","eye1Color":"#000000","eye2Color":"#000000","eye3Color":"#000000","eyeBall1Color":"#000000","eyeBall2Color":"#000000","eyeBall3Color":"#000000","gradientColor1":"","gradientColor2":"","gradientType":"linear","gradientOnEyes":"true","logo":"b16b7f94376a16f93a1f8f2398f06ea98efca44c.png","logoMode":"clean"},"size":1500,"download":"imageUrl","file":"png"})
16+
17+
fn = json.loads(r.text)
18+
#print(fn)
19+
20+
print("Downlodading generated QR for P" + s.format(i))
21+
22+
f = open('P' + s.format(i) + '.png', 'wb')
23+
f.write(requests.get('https:' + fn['imageUrl']).content)
24+
f.close()
25+
26+
print("Downloaded P" + s.format(i), flush=True, end="\n\n")
27+
28+
29+
for i in range(1,ns):
30+
print("Generating QR Code for S" + s.format(i), flush=True)
31+
r = requests.post('https://qr-generator.qrcode.studio/qr/custom', json={"data":"S" + s.format(i) ,"config":{"body":"square","eye":"frame1","eyeBall":"ball0","erf1":["fh"],"erf2":[],"erf3":["fh","fv"],"brf1":[],"brf2":[],"brf3":[],"bodyColor":"#000000","bgColor":"#FFFFFF","eye1Color":"#000000","eye2Color":"#000000","eye3Color":"#000000","eyeBall1Color":"#000000","eyeBall2Color":"#000000","eyeBall3Color":"#000000","gradientColor1":"","gradientColor2":"","gradientType":"linear","gradientOnEyes":"true","logo":"b16b7f94376a16f93a1f8f2398f06ea98efca44c.png","logoMode":"clean"},"size":1500,"download":"imageUrl","file":"png"})
32+
33+
fn = json.loads(r.text)
34+
#print(fn)
35+
36+
print("Downlodading generated QR for S" + s.format(i))
37+
38+
f = open('S' + s.format(i) + '.png', 'wb')
39+
f.write(requests.get('https:' + fn['imageUrl']).content)
40+
f.close()
41+
42+
print("Downloaded S" + s.format(i), flush=True, end="\n\n")

0 commit comments

Comments
 (0)