Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from urllib.request import urlopen
- import quopri
- with open("sam.eml", "rb") as f:
- ct = 1
- lines = quopri.decodestring(f.read())
- for l in lines.split():
- if l.find(b"href=\"https://www.tadpoles.com/m/p") == 0:
- parts = l.split(b"\"")
- if len(parts) == 3:
- url = parts[1] + b"?d=t"
- res = urlopen(url.decode("utf-8"))
- with open(str(ct) + ".png", "wb") as output:
- output.write(res.read())
- ct += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement