Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
88598ef
Merged all fixes
Mirabis Nov 3, 2014
26104ed
dereferer for imdb
Mirabis Nov 3, 2014
b860770
Mirabis Mar 1, 2015
1cef3dc
Remove uuuid usage
Mirabis Mar 2, 2015
79951cf
Fix spacing issues
Mirabis Mar 2, 2015
075c1ce
Mirabis Mar 2, 2015
3f4a518
Fix invalid syntax
Mirabis Mar 2, 2015
0d719fc
Update builtin_params.ini
Mirabis Mar 2, 2015
cb1ceff
removed space
Mirabis Mar 2, 2015
61a234c
fix for integer
Mirabis Mar 2, 2015
483b8a1
Fix auto update and params
Mirabis Mar 2, 2015
f45ef00
Changed User agent
Mirabis Mar 2, 2015
47cc990
NzbDrone fix
Mirabis Mar 2, 2015
d3d75c2
Completing new update
Mirabis Mar 2, 2015
c6662a1
Update af_Fanzub.py
Mirabis Mar 18, 2015
34a229c
Update jquery.min.js
Mirabis Mar 18, 2015
30218e6
Update main_page.html
Mirabis Mar 18, 2015
44e8436
+ no longer asks for the wrong login/pw on accessing the config
Mirabis May 20, 2015
236f833
Changed NZBClub feed url
Mirabis Jun 1, 2015
45aeacf
Update README.md
Mirabis Jun 1, 2015
c64ba1c
PirateNzb Fix
Mirabis Jun 27, 2015
270cb72
Small changes and merge of cauchy49's pull request on pillone's fork
Mirabis Aug 3, 2015
cec6424
Merge remote-tracking branch 'origin/master'
Mirabis Aug 3, 2015
e258249
Update README.md
Mirabis Aug 3, 2015
155d398
Merged Cozza38's pull request
Mirabis Sep 15, 2015
6311f88
Merge remote-tracking branch 'origin/master'
Mirabis Sep 15, 2015
57c0fa2
Added tvdbid support. Rearranged search priority order
HackedServer Nov 2, 2015
537a32b
Removed .idea
HackedServer Nov 2, 2015
6921ac3
Fixed if->elif
HackedServer Nov 2, 2015
a36ff00
Added Trakt API information to README.md
HackedServer Nov 2, 2015
46d0d25
Added Trakt API information to README.md #2
HackedServer Nov 2, 2015
61cca73
create branch nzbget-fix
invalid-email-address Nov 10, 2015
ad3fa18
remove .idea folder
invalid-email-address Nov 10, 2015
cda9b0f
fixed push to NZBGet
Undeadhunter Nov 10, 2015
cc71d05
Merge pull request #1 from Undeadhunter/nzbget-fix
Undeadhunter Nov 10, 2015
947121c
Merge pull request #4 from Undeadhunter/master
Mirabis Nov 10, 2015
e8059f4
Merge pull request #2 from HackedServer/master
Mirabis Nov 10, 2015
f621712
+ Merged Undeadhunters NzbGet fix
Mirabis Nov 10, 2015
b1fa93f
Merge remote-tracking branch 'origin/master'
Mirabis Nov 10, 2015
48bd64a
Update README.md
Mirabis Nov 10, 2015
8e2f0ea
Better TV support
Mirabis Nov 10, 2015
ab29c0c
Merge remote-tracking branch 'origin/master'
Mirabis Nov 10, 2015
59fe3ec
Update README.md
Mirabis Nov 11, 2015
b573a4c
Changing code everywhere ... to figure it out, issue most likely is w…
Undeadhunter Nov 13, 2015
ce8202f
Fixed CP fetch
Undeadhunter Nov 16, 2015
6a0a373
Revert "Changing code everywhere ... to figure it out, issue most lik…
Nov 16, 2015
56fccce
Merge pull request #8 from Undeadhunter/pr/7
Undeadhunter Nov 16, 2015
88ee323
Revert "Pr 7"
Undeadhunter Nov 16, 2015
a730f43
Merge pull request #9 from Mirabis/revert-8-pr/7
Undeadhunter Nov 16, 2015
2d0aaa1
Fix CP issue
Undeadhunter Nov 16, 2015
6fd1ffc
Update WarperModule.py
Undeadhunter Nov 16, 2015
ee979c0
Merge pull request #10 from Mirabis/couchpotato-fix
Mirabis Nov 17, 2015
42ffffd
Fix Sonarr manual search only giving one result
JudsonHat Nov 18, 2015
08eb6dc
Merge pull request #11 from judhat2/master
Mirabis Nov 18, 2015
a844f32
changed the provider url for api request
JudsonHat Nov 21, 2015
a45c784
Merge pull request #12 from judhat2/master
Mirabis Nov 21, 2015
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
879 changes: 444 additions & 435 deletions NZBmegasearch/ApiModule.py

Large diffs are not rendered by default.

1,272 changes: 634 additions & 638 deletions NZBmegasearch/DeepsearchModule.py

Large diffs are not rendered by default.

731 changes: 368 additions & 363 deletions NZBmegasearch/SearchModule.py

Large diffs are not rendered by default.

203 changes: 102 additions & 101 deletions NZBmegasearch/SearchModules/Newznab.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## #
#~ This file is part of NZBmegasearch by 0byte.
#~
#~ NZBmegasearch is free software: you can redistribute it and/or modify
#~ it under the terms of the GNU General Public License as published by
#~ the Free Software Foundation, either version 3 of the License, or
#~ (at your option) any later version.
#~
#~ NZBmegasearch is distributed in the hope that it will be useful,
#~ but WITHOUT ANY WARRANTY; without even the implied warranty of
#~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#~ GNU General Public License for more details.
#~
#~ You should have received a copy of the GNU General Public License
#~ along with NZBmegasearch. If not, see <http://www.gnu.org/licenses/>.
# ~ This file is part of NZBmegasearch by 0byte.
# ~
# ~ NZBmegasearch is free software: you can redistribute it and/or modify
# ~ it under the terms of the GNU General Public License as published by
# ~ the Free Software Foundation, either version 3 of the License, or
# ~ (at your option) any later version.
# ~
# ~ NZBmegasearch is distributed in the hope that it will be useful,
# ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
# ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# ~ GNU General Public License for more details.
# ~
# ~ You should have received a copy of the GNU General Public License
# ~ along with NZBmegasearch. If not, see <http://www.gnu.org/licenses/>.
# # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## #
import ConfigParser
from SearchModule import *
Expand All @@ -21,95 +21,96 @@

# Search on Newznab
class Newznab(SearchModule):

# Set up class variables
def __init__(self, configFile=None):
super(Newznab, self).__init__()
self.name = 'Newznab'
self.typesrch = 'NAB'
self.queryURL = 'xxxx'
self.baseURL = 'xxxx'
self.nzbDownloadBaseURL = 'NA'
self.builtin = 0
self.inapi = 1
self.api_catsearch = 1
self.agent_headers = { 'User-Agent': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1' }

self.categories = {'Console': {'code':[1000,1010,1020,1030,1040,1050,1060,1070,1080], 'pretty': 'Console'},
'Movie' : {'code': [2000, 2010, 2020], 'pretty': 'Movie'},
'Movie_HD' : {'code': [2040, 2050, 2060], 'pretty': 'HD'},
'Movie_SD' : {'code': [2030], 'pretty': 'SD'},
'Audio' : {'code': [3000, 3010, 3020, 3030, 3040], 'pretty': 'Audio'},
'PC' : {'code': [4000, 4010, 4020, 4030, 4040, 4050, 4060, 4070], 'pretty': 'PC'},
'TV' : {'code': [5000, 5020], 'pretty': 'TV'},
'TV_SD' : {'code': [5030], 'pretty': 'SD'},
'TV_HD' : {'code': [5040], 'pretty': 'HD'},
'XXX' : {'code': [6000, 6010, 6020, 6030, 6040], 'pretty': 'XXX'},
'Other' : {'code': [7000, 7010], 'pretty': 'Other'},
'Ebook' : {'code': [7020], 'pretty': 'Ebook'},
'Comics' : {'code': [7030], 'pretty': 'Comics'},
}
self.category_inv= {}
for key in self.categories.keys():
prettyval = self.categories[key]['pretty']
for i in xrange(len(self.categories[key]['code'])):
val = self.categories[key]['code'][i]
self.category_inv[str(val)] = prettyval
# Set up class variables
def __init__(self, configFile=None):
super(Newznab, self).__init__()
self.name = 'Newznab'
self.typesrch = 'NAB'
self.queryURL = 'xxxx'
self.baseURL = 'xxxx'
self.nzbDownloadBaseURL = 'NA'
self.builtin = 0
self.inapi = 1
self.api_catsearch = 1
self.agent_headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'}

self.categories = {
'Console': {'code': [1000, 1010, 1020, 1030, 1040, 1050, 1060, 1070, 1080], 'pretty': 'Console'},
'Movie': {'code': [2000, 2010, 2020, 2030, 2040, 250, 2060], 'pretty': 'Movie (ALL)'},
'Movie_HD': {'code': [2040, 2050, 2060], 'pretty': 'Movie (HD)'},
'Movie_SD': {'code': [2030], 'pretty': 'Movie (SD)'},
'Audio': {'code': [3000, 3010, 3020, 3030, 3040], 'pretty': 'Audio'},
'Games': {'code': [100, ], 'pretty': 'Games'},
'PC': {'code': [4000, 4010, 4020, 4030, 4040, 4050, 4060, 4070], 'pretty': 'PC'},
'TV': {'code': [5000, 5020], 'pretty': 'TV'},
'TV_SD': {'code': [5030], 'pretty': 'SD'},
'TV_HD': {'code': [5040], 'pretty': 'HD'},
'XXX': {'code': [6000, 6010, 6020, 6030, 6040, 6060, 6070], 'pretty': 'XXX'},
'Anime': {'code': [5070], 'pretty': 'Anime'},
'Books': {'code': [7000, 7020], 'pretty': 'Books'},
'Mags': {'code': [7010], 'pretty': 'Magazines'},
'Ebook': {'code': [7020], 'pretty': 'Ebook'},
'Comics': {'code': [7030], 'pretty': 'Comics'},
}
self.category_inv = {}
for key in self.categories.keys():
prettyval = self.categories[key]['pretty']
for i in xrange(len(self.categories[key]['code'])):
val = self.categories[key]['code'][i]
self.category_inv[str(val)] = prettyval


#~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
def search_raw(self, queryopt, cfg):
urlParams = dict(
queryopt,
o='xml',
apikey=cfg['api']
)
self.queryURL = cfg['url'] + '/api'
self.baseURL = cfg['url']

parsed_data = self.parse_xmlsearch(urlParams, cfg['timeout'])
return parsed_data

#~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
def search_raw(self, queryopt, cfg):
urlParams = dict(
queryopt,
o='xml',
apikey=cfg['api']
)
self.queryURL = cfg['url'] + '/api'
self.baseURL = cfg['url']

def search(self, queryString, cfg):
# Get text
urlParams = dict(
t='search',
q=queryString,
o='xml',
apikey=cfg['api']
)
self.queryURL = cfg['url'] + '/api'
self.baseURL = cfg['url']

humanprovider = urlparse.urlparse(cfg['url']).hostname
self.name = humanprovider.replace("www.", "")
parsed_data = self.parse_xmlsearch(urlParams, cfg['timeout'], cfg)
return parsed_data
parsed_data = self.parse_xmlsearch(urlParams, cfg['timeout'])
return parsed_data

#~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

def checkreturn(self, data):

retcode = self.default_retcode
limitpos = data.encode('utf-8').lower().find('<error code="500"')
if(limitpos != -1):
mssg = 'Download/Search limit reached ' + self.queryURL
limitpos_comment = data.encode('utf-8').find('description="')
if(limitpos_comment != -1):
mssg = data.encode('utf-8')[limitpos_comment+13:]
log.error (mssg)
retcode = [500, sanitize_strings(mssg).replace(".", " ").capitalize(), 0,'']

limitpos = data.encode('utf-8').lower().find('<error code="100"')
if(limitpos != -1):
mssg = 'Incorrect user credentials ' + self.queryURL
limitpos_comment = data.encode('utf-8').find('description="')
if(limitpos_comment != -1):
mssg = data.encode('utf-8')[limitpos_comment+13:]
log.error (mssg)
retcode = [100, sanitize_strings(mssg).replace(".", " ").capitalize(),0,'']
return retcode
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

def search(self, queryString, cfg):
# Get text
urlParams = dict(
t='search',
q=queryString,
o='xml',
apikey=cfg['api']
)
self.queryURL = cfg['url'] + '/api'
self.baseURL = cfg['url']

humanprovider = urlparse.urlparse(cfg['url']).hostname
self.name = humanprovider.replace("www.", "")
parsed_data = self.parse_xmlsearch(urlParams, cfg['timeout'], cfg)
return parsed_data

# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

def checkreturn(self, data):

retcode = self.default_retcode
limitpos = data.encode('utf-8').lower().find('<error code="500"')
if (limitpos != -1):
mssg = 'Download/Search limit reached ' + self.queryURL
limitpos_comment = data.encode('utf-8').find('description="')
if (limitpos_comment != -1):
mssg = data.encode('utf-8')[limitpos_comment + 13:]
log.error(mssg)
retcode = [500, sanitize_strings(mssg).replace(".", " ").capitalize(), 0, '']

limitpos = data.encode('utf-8').lower().find('<error code="100"')
if (limitpos != -1):
mssg = 'Incorrect user credentials ' + self.queryURL
limitpos_comment = data.encode('utf-8').find('description="')
if (limitpos_comment != -1):
mssg = data.encode('utf-8')[limitpos_comment + 13:]
log.error(mssg)
retcode = [100, sanitize_strings(mssg).replace(".", " ").capitalize(), 0, '']
return retcode
30 changes: 15 additions & 15 deletions NZBmegasearch/SearchModules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## #
#~ This file is part of NZBmegasearch by pillone.
#~
#~ NZBmegasearch is free software: you can redistribute it and/or modify
#~ it under the terms of the GNU General Public License as published by
#~ the Free Software Foundation, either version 3 of the License, or
#~ (at your option) any later version.
#~
#~ NZBmegasearch is distributed in the hope that it will be useful,
#~ but WITHOUT ANY WARRANTY; without even the implied warranty of
#~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#~ GNU General Public License for more details.
#~
#~ You should have received a copy of the GNU General Public License
#~ along with NZBmegasearch. If not, see <http://www.gnu.org/licenses/>.
# # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## #
# ~ This file is part of NZBmegasearch by pillone.
# ~
# ~ NZBmegasearch is free software: you can redistribute it and/or modify
# ~ it under the terms of the GNU General Public License as published by
# ~ the Free Software Foundation, either version 3 of the License, or
# ~ (at your option) any later version.
# ~
# ~ NZBmegasearch is distributed in the hope that it will be useful,
# ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
# ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# ~ GNU General Public License for more details.
# ~
# ~ You should have received a copy of the GNU General Public License
# ~ along with NZBmegasearch. If not, see <http://www.gnu.org/licenses/>.
# # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## #
Loading