1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2025-03-09 13:24:53 +00:00

IMP: Added non-default Newznzb category to Newznab UID GUI field. Type in '#8020' or whatever category comics is on newznab installation (not required for normal newznabs), IMP: When issue was found via torrents by RSS, it would continue to look via db/api searches'

This commit is contained in:
evilhero 2013-10-31 14:54:19 -04:00
parent c030ba5465
commit eace56d92e
2 changed files with 20 additions and 3 deletions

View file

@ -238,9 +238,16 @@ def nzbs(provider=None):
for newznab_host in newznab_hosts:
if newznab_host[3] is None:
newznabuid = '1'
newznabcat = '7030'
else:
newznabuid = newznab_host[3]
feed = newznab_host[1].rstrip() + '/rss?t=7030&dl=1&i=' + str(newznabuid) + '&r=' + newznab_host[2].rstrip()
if '#' not in newznab_host[3]:
newznabuid = newznab_host[3]
newznabcat = '7030'
else:
newzst = newznab_host[3].find('#')
newznabuid = newznab_host[3][:newzst]
newznabcat = newznab_host[3][newzst+1:]
feed = newznab_host[1].rstrip() + '/rss?t=' + str(newznabcat) + '&dl=1&i=' + str(newznabuid) + '&r=' + newznab_host[2].rstrip()
feedme = feedparser.parse(feed)
site = newznab_host[0].rstrip()
feedthis.append({"feed": feedme,

View file

@ -155,6 +155,10 @@ def search_init(ComicName, IssueNumber, ComicYear, SeriesYear, IssueDate, IssueI
if i == 1: searchmode = 'rss' #order of ops - this will be used first.
elif i == 2: searchmode = 'api'
if findit == 'yes':
logger.fdebug('Found result on first run, exiting search module now.')
break
logger.fdebug("Initiating Search via : " + str(searchmode))
torprtmp = torpr
@ -365,6 +369,12 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
name_newznab = newznab_host[0].rstrip()
host_newznab = newznab_host[1].rstrip()
apikey = newznab_host[2].rstrip()
if '#' in newznab_host[3].rstrip():
catstart = newznab_host[3].find('#')
category_newznab = newznab_host[3][catstart+1:]
logger.fdebug('non-default Newznab category set to :' + str(category_newznab))
else:
category_newznab = '7030'
logger.fdebug("using Newznab host of : " + str(name_newznab))
if RSS == "yes":
@ -566,7 +576,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, nzbprov, nzbpr, Is
if host_newznab[len(host_newznab)-1:len(host_newznab)] != '/':
host_newznab_fix = str(host_newznab) + "/"
else: host_newznab_fix = host_newznab
findurl = str(host_newznab_fix) + "api?t=search&q=" + str(comsearch) + "&o=xml&cat=7030"
findurl = str(host_newznab_fix) + "api?t=search&q=" + str(comsearch) + "&o=xml&cat=" + str(category_newznab)
elif nzbprov == 'nzbx':
bb = prov_nzbx.searchit(comsearch)
if nzbprov != 'nzbx':