Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. from urllib.request import urlopen
  2. import quopri
  3.  
  4.  
  5. with open("sam.eml", "rb") as f:
  6. ct = 1
  7. lines = quopri.decodestring(f.read())
  8. for l in lines.split():
  9. if l.find(b"href=\"https://www.tadpoles.com/m/p") == 0:
  10. parts = l.split(b"\"")
  11. if len(parts) == 3:
  12. url = parts[1] + b"?d=t"
  13. res = urlopen(url.decode("utf-8"))
  14. with open(str(ct) + ".png", "wb") as output:
  15. output.write(res.read())
  16. ct += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement