Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security improvements: use valid HTTPS where possible #624

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nzbhydra/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def imdbid_to_tmdbid(imdbid):


def find_series_ids(input):
info = webaccess.get("http://api.tvmaze.com/search/shows?q=%s" % input)
info = webaccess.get("https://api.tvmaze.com/search/shows?q=%s" % input)
info.raise_for_status()
results = []
for result in info.json():
Expand All @@ -138,15 +138,15 @@ def title_from_id(identifier_key, identifier_value):
if identifier_key == "imdbid":
if identifier_value[0:2] != "tt":
identifier_value = "tt%s" % identifier_value
url = furl("http://www.omdbapi.com").add({"i": identifier_value, "plot": "short", "r": "json"}).tostr()
url = furl("https://www.omdbapi.com").add({"i": identifier_value, "plot": "short", "r": "json"}).tostr()
omdb = webaccess.get(url)
return omdb.json()["Title"]

if identifier_key not in ("rid", "tvdbid"):
raise AttributeError("Unknown identifier %s" % identifier_key)

tvmaze_key = "tvrage" if identifier_key == "rid" else "thetvdb"
tvmaze = webaccess.get(furl("http://api.tvmaze.com/lookup/shows").add({tvmaze_key: identifier_value}).url)
tvmaze = webaccess.get(furl("https://api.tvmaze.com/lookup/shows").add({tvmaze_key: identifier_value}).url)
if tvmaze.status_code == 404:
#Unfortunately TVMaze returns a 404 for unknown/invalid IDs
raise ExternalApiInfoException("Unable to find id %s and value %s at TVMaze" % (identifier_key, identifier_value))
Expand Down Expand Up @@ -286,4 +286,4 @@ def convertIdToAny(fromType, possibleToTypes, id):





2 changes: 1 addition & 1 deletion nzbhydra/socks_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setSOCKSproxy(sockshost,socksport):
socket.socket = socks.socksocket

try:
return urllib2.urlopen('http://ipinfo.io/ip').read().rstrip()
return urllib2.urlopen('https://ipinfo.io/ip').read().rstrip()
except:
return None

4 changes: 2 additions & 2 deletions nzbhydra/webaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def getCleanProxyUrl(url):
def get(url, **kwargs):
global proxies
myproxies = proxies if proxies is not None and furl(url).host not in ["127.0.0.1", "localhost"] and "192.168" not in str(url) else None
return requests.get(url, proxies=myproxies, verify=False, **kwargs)
return requests.get(url, proxies=myproxies, **kwargs)


def post(url, **kwargs):
global proxies
myproxies = proxies if proxies is not None and furl(url).host not in ["127.0.0.1", "localhost"] and "192.168" not in str(url) else None
return requests.post(url, proxies=myproxies, verify=False, **kwargs)
return requests.post(url, proxies=myproxies, **kwargs)