diff --git a/buku b/buku index 9e1ae50..081cef9 100755 --- a/buku +++ b/buku @@ -25,7 +25,7 @@ import readline import webbrowser import html.parser as HTMLParser from http.client import HTTPConnection, HTTPSConnection -from urllib.parse import urljoin, unquote +from urllib.parse import urljoin, quote, unquote import signal import shutil @@ -214,6 +214,12 @@ def getPageResp(url, redir=False): print("server: [%s]" % server) print("URL: [%s]" % url) + # Handle URLs passed with %xx escape + try: + url.encode('ascii') + except: + url = quote(url) + urlconn.request("GET", url) resp = urlconn.getresponse() return (urlconn, resp)