Handle URLs passed with %xx escape.
E.g.: "https://linuxreference.wordpress.com/2010/12/28/25-even-more-%E2%80%93-sick-linux-commands/"
This commit is contained in:
parent
b499daade4
commit
4c25e0b1c0
8
buku
8
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)
|
||||
|
Loading…
Reference in New Issue
Block a user