From c94e71a4c2bb29dc0caa23d3ca1ab8e2e0e0e711 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 1 Oct 2014 13:03:32 +0100 Subject: [PATCH 1/2] Added fix for correct header content-type for NzbDrone for RSS and API routes. --- NZBmegasearch/mega2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NZBmegasearch/mega2.py b/NZBmegasearch/mega2.py index 145ff85..4b14fc1 100644 --- a/NZBmegasearch/mega2.py +++ b/NZBmegasearch/mega2.py @@ -256,13 +256,13 @@ def rss(): if(len(cfgsets.cgen['general_apikey'])): if('apikey' in request.args): if(request.args['apikey'] == cfgsets.cgen['general_apikey']): - return apiresp.dosearch_rss(request.args, urlparse(request.url)) + return apiresp.dosearch_rss(request.args, urlparse(request.url)), 200, {'Content-Type':'application/rss+xml'} else: return '[API key protection ACTIVE] Wrong key selected' else: return '[API key protection ACTIVE] API key required' else: - return apiresp.dosearch_rss(request.args, urlparse(request.url)) + return apiresp.dosearch_rss(request.args, urlparse(request.url)), 200, {'Content-Type':'application/rss+xml'} #~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ @@ -336,13 +336,13 @@ def api(): if(len(cfgsets.cgen['general_apikey'])): if('apikey' in request.args): if(request.args['apikey'] == cfgsets.cgen['general_apikey']): - return apiresp.dosearch(request.args, urlparse(request.url)) + return apiresp.dosearch(request.args, urlparse(request.url)), 200, {'Content-Type':'application/rss+xml'} else: return '[API key protection ACTIVE] Wrong key selected' else: return '[API key protection ACTIVE] API key required' else: - return apiresp.dosearch(request.args, urlparse(request.url)) + return apiresp.dosearch(request.args, urlparse(request.url)), 200, {'Content-Type':'application/rss+xml'} #~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ From 17ea4cdecf8341aad37fa68921f63c71c4fd5f00 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 2 Oct 2014 07:56:38 +0100 Subject: [PATCH 2/2] Fixed issue where NzbDrone only parses one result Fixed issue where NzbDrone only parses one result from the NzbMegasearcH API/ --- NZBmegasearch/ApiModule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NZBmegasearch/ApiModule.py b/NZBmegasearch/ApiModule.py index 96bf319..a6a6e91 100644 --- a/NZBmegasearch/ApiModule.py +++ b/NZBmegasearch/ApiModule.py @@ -426,7 +426,7 @@ def cleanUpResultsXML(self, results): #~ non CP request generate might errors if no url is found in the permalink if(self.typesearch != 0): - niceResults_row['encodedurl'] = 'http://bogus.gu/bog' + niceResults_row['encodedurl'] = results[i]['url'] niceResults.append( niceResults_row)