Skip to content

Instantly share code, notes, and snippets.

@mafux777
Created January 30, 2021 20:45
Show Gist options
  • Save mafux777/02d14ceae86d5edc8f79038a23fa53a9 to your computer and use it in GitHub Desktop.
Save mafux777/02d14ceae86d5edc8f79038a23fa53a9 to your computer and use it in GitHub Desktop.
Grab images for hashmasks
import re
import requests
with open("Hashmasks Provenance Record") as hash:
while(hash):
t = hash.readline()
t0 = t.split("|")
if len(t0)==3:
t2 = t0[2]
t3 = re.search("[a-zA-Z0-9]+", t2)
if t3:
t4 = t3.group(0)
print(f"{t4}")
r = requests.get(f"https://ipfs.io/ipfs/{t4}")
img = r.content
with open(f"{t4}.png", "wb") as t5:
t5.write(img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment