From dc81c3e4cfd4393fa711ed6156d39e956e205a6c Mon Sep 17 00:00:00 2001 From: cauchy49 Date: Thu, 30 Jul 2015 21:32:14 +0200 Subject: [PATCH] Update ApiModule.py correct url when "Reverse proxy dir or full url" setting is enabled --- NZBmegasearch/ApiModule.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/NZBmegasearch/ApiModule.py b/NZBmegasearch/ApiModule.py index 96bf319..2630704 100644 --- a/NZBmegasearch/ApiModule.py +++ b/NZBmegasearch/ApiModule.py @@ -412,10 +412,15 @@ def cleanUpResultsXML(self, results): #~ print qryforwarp dt1 = datetime.datetime.fromtimestamp(int(results[i]['posting_date_timestamp'])) human_readable_time = dt1.strftime("%a, %d %b %Y %H:%M:%S") - + + if(self.cgen['revproxy'].find('http') != -1): + url = self.cgen['revproxy'] + '/warp?x='+qryforwarp + else: + url = self.rqurl + self.cgen['revproxy'] + '/warp?x='+qryforwarp + niceResults_row = { #~ 'url': results[i]['url'], - 'url':self.rqurl + self.cgen['revproxy'] + '/warp?x='+qryforwarp, + 'url': url, 'encodedurl': qryforwarp, 'title':results[i]['title'], 'filesize':results[i]['size'],