Created
April 15, 2015 17:18
-
-
Save r0yfire/e9940605c6e7a3a55ec5 to your computer and use it in GitHub Desktop.
Decode quoted-printable text in a file
This file contains 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
#!/usr/bin/python | |
""" | |
Decode quoted-printable text in a file | |
""" | |
import sys | |
import quopri | |
from BeautifulSoup import BeautifulSoup as bs | |
print '\t\tHTML Extract0r 2014\n' | |
f = open(sys.argv[1], 'r') | |
# Decode quoted-printable | |
encoded = f.read() | |
f.close() | |
html = quopri.decodestring(encoded) | |
# Make pretty | |
soup = bs(html) | |
html = soup.prettify() | |
# Save | |
f = open(sys.argv[1], 'w') | |
f.write(html) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment