encode the title before making a path

This commit is contained in:
Bryan Bishop 2013-01-10 10:17:30 -08:00
parent f405e1fb50
commit aa98a92edb
1 changed files with 3 additions and 3 deletions

View File

@ -91,15 +91,15 @@ def download(phenny, input, verbose=True):
data = response.content
# grr..
title = title.encode("ascii", "ignore")
path = os.path.join("/home/bryan/public_html/papers2/paperbot/", title + ".pdf")
file_handler = open(path, "w")
file_handler.write(data)
file_handler.close()
# grr..
title = title.encode("ascii", "ignore")
filename = requests.utils.quote(title)
url = "http://diyhpl.us/~bryan/papers2/paperbot/" + filename + ".pdf"