Created
January 30, 2021 20:45
-
-
Save mafux777/02d14ceae86d5edc8f79038a23fa53a9 to your computer and use it in GitHub Desktop.
Grab images for hashmasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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