Fix issues with fetching pages with %20.

Signed-off-by: Arun Prakash Jana <engineerarun@gmail.com>
This commit is contained in:
Arun Prakash Jana 2016-03-25 08:08:03 +05:30
parent 1c982ccd51
commit ea02856bc1

6
buku
View File

@ -26,7 +26,7 @@ import webbrowser
import html.parser as HTMLParser
from http.client import HTTPConnection
from http.client import HTTPSConnection
from urllib.parse import urljoin, unquote
from urllib.parse import urljoin, quote, unquote
import signal
# Import libraries needed for encryption
@ -161,9 +161,9 @@ def getPageResp(url, redir=False):
if debug:
print("server: [%s]" % server)
print("URL: [%s]" % unquote(url))
print("URL: [%s]" % quote(unquote(url)))
urlconn.request("GET", unquote(url))
urlconn.request("GET", quote(unquote(url)))
resp = urlconn.getresponse()
return (resp, urlconn)