diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-02-14 11:41:59 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-02-14 11:41:59 +0100 |
commit | f9c61cbd2a4f44a84367f163d0258f676acb1f17 (patch) | |
tree | ca23e3c2b88b2959d4c5f82389a8f939b8a10aee /src/web | |
parent | Major changes to the right panel. (diff) | |
download | newspipe-f9c61cbd2a4f44a84367f163d0258f676acb1f17.tar.gz newspipe-f9c61cbd2a4f44a84367f163d0258f676acb1f17.tar.bz2 newspipe-f9c61cbd2a4f44a84367f163d0258f676acb1f17.zip |
Removed proxy support. Not so used and better to set at the system level.
Diffstat (limited to 'src/web')
-rwxr-xr-x | src/web/utils.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/web/utils.py b/src/web/utils.py index 9e3ad3ed..f770f597 100755 --- a/src/web/utils.py +++ b/src/web/utils.py @@ -241,34 +241,6 @@ def clean_url(url): parsed_url.fragment ]).rstrip('=') -def open_url(url): - """ - Open an URL with the proxy and the user-agent - specified in the configuration file. - """ - if conf.HTTP_PROXY == "": - proxy = {} - else: - proxy = {"http": conf.HTTP_PROXY} - opener = urllib.request.FancyURLopener(proxy) - try: - opener = urllib.request.build_opener() - opener.addheaders = [('User-agent', conf.USER_AGENT)] - return (True, opener.open(url)) - except urllib.error.HTTPError as e: - # server couldn't fulfill the request - error = (url, e.code, - http.server.BaseHTTPRequestHandler.responses[e.code][1]) - return (False, error) - except urllib.error.URLError as e: - # failed to reach the server - if type(e.reason) == str: - error = (url, e.reason, e.reason) - else: - error = (url, e.reason.errno, e.reason.strerror) - return (False, error) - - def load_stop_words(): """ Load the stop words and return them in a list. |