Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import sys
  2. import pycurl
  3. import struct
  4. from binascii import unhexlify, crc32
  5. import urllib2
  6.  
  7. transaction = str(sys.argv[1])
  8. data = urllib2.urlopen("https://blockchain.info/tx/"+transaction+"?show_adv=true")
  9. dataout = b''
  10. atoutput = False
  11.  
  12. for line in data:
  13.  
  14. if 'Output Scripts' in line:
  15. atoutput = True
  16.  
  17. if '</table>' in line:
  18. atoutput = False
  19.  
  20. if atoutput:
  21. if len(line) > 100:
  22. chunks = line.split(' ')
  23. for c in chunks:
  24. if 'O' not in c and '\n' not in c and '>' not in c and '<' not in c:
  25. dataout += unhexlify(c.encode('utf8'))
  26.  
  27. length = struct.unpack('<L', dataout[0:4])[0]
  28. checksum = struct.unpack('<L', dataout[4:8])[0]
  29. dataout = dataout[8:8+length]
  30.  
  31. print dataout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement