mirror of
https://github.com/evilhero/mylar
synced 2025-03-09 21:33:42 +00:00
FIX:(#886) Fixed issue for all the geeks in us (error was given as invalid api key within sabnzbd on an attempted send)
This commit is contained in:
parent
b8a478a93b
commit
1d4ac8a97b
2 changed files with 17 additions and 9 deletions
|
@ -328,7 +328,8 @@ def nzbs(provider=None):
|
||||||
newzst = newznab_host[3].find('#')
|
newzst = newznab_host[3].find('#')
|
||||||
newznabuid = newznab_host[3][:newzst]
|
newznabuid = newznab_host[3][:newzst]
|
||||||
newznabcat = newznab_host[3][newzst+1:]
|
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()
|
# 11-21-2014: added &num=100 to return 100 results (or maximum) - unsure of cross-reliablity
|
||||||
|
feed = newznab_host[1].rstrip() + '/rss?t=' + str(newznabcat) + '&dl=1&i=' + str(newznabuid) + '&num=100&&r=' + newznab_host[2].rstrip()
|
||||||
feedme = feedparser.parse(feed)
|
feedme = feedparser.parse(feed)
|
||||||
site = newznab_host[0].rstrip()
|
site = newznab_host[0].rstrip()
|
||||||
feedthis.append({"feed": feedme,
|
feedthis.append({"feed": feedme,
|
||||||
|
|
|
@ -1637,7 +1637,14 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
|
||||||
nzbid = path_parts[0].rsplit('/',1)[1]
|
nzbid = path_parts[0].rsplit('/',1)[1]
|
||||||
elif nzbprov == 'newznab':
|
elif nzbprov == 'newznab':
|
||||||
#if in format of http://newznab/getnzb/<id>.nzb&i=1&r=apikey
|
#if in format of http://newznab/getnzb/<id>.nzb&i=1&r=apikey
|
||||||
nzbid = os.path.splitext(link)[0].rsplit('/', 1)[1]
|
tmpid = urlparse.urlparse(link)[4] #param 4 is the query string from the url.
|
||||||
|
if tmpid == '' or tmpid is None:
|
||||||
|
nzbid = os.path.splitext(link)[0].rsplit('/', 1)[1]
|
||||||
|
else:
|
||||||
|
# for the geek in all of us...
|
||||||
|
st = tmpid.find('&id')
|
||||||
|
end = tmpid.find('&',st+1)
|
||||||
|
nzbid = re.sub('&id=','', tmpid[st:end]).strip()
|
||||||
|
|
||||||
|
|
||||||
if mylar.FAILED_DOWNLOAD_HANDLING:
|
if mylar.FAILED_DOWNLOAD_HANDLING:
|
||||||
|
@ -1743,7 +1750,7 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
|
||||||
tmpapi = str(tmpapi) + str(mylar.NZBGET_USERNAME) + ":" + str(mylar.NZBGET_PASSWORD)
|
tmpapi = str(tmpapi) + str(mylar.NZBGET_USERNAME) + ":" + str(mylar.NZBGET_PASSWORD)
|
||||||
tmpapi = str(tmpapi) + "@" + str(nzbget_host) + ":" + str(mylar.NZBGET_PORT) + "/xmlrpc"
|
tmpapi = str(tmpapi) + "@" + str(nzbget_host) + ":" + str(mylar.NZBGET_PORT) + "/xmlrpc"
|
||||||
server = ServerProxy(tmpapi)
|
server = ServerProxy(tmpapi)
|
||||||
send_to_nzbget = server.appendurl(nzbname + ".nzb", str(mylar.NZBGET_CATEGORY), int(nzbgetpriority), True, linkapi)
|
send_to_nzbget = server.appendurl(nzbname + ".nzb", str(mylar.NZBGET_CATEGORY), int(nzbgetpriority), True, urllib.quote_plus(linkapi))
|
||||||
sent_to = "NZBGet"
|
sent_to = "NZBGet"
|
||||||
if send_to_nzbget is True:
|
if send_to_nzbget is True:
|
||||||
logger.info("Successfully sent nzb to NZBGet!")
|
logger.info("Successfully sent nzb to NZBGet!")
|
||||||
|
@ -1755,26 +1762,26 @@ def searcher(nzbprov, nzbname, comicinfo, link, IssueID, ComicID, tmpprov, direc
|
||||||
elif mylar.USE_SABNZBD:
|
elif mylar.USE_SABNZBD:
|
||||||
# let's build the send-to-SAB string now:
|
# let's build the send-to-SAB string now:
|
||||||
# changed to just work with direct links now...
|
# changed to just work with direct links now...
|
||||||
tmpapi = str(mylar.SAB_HOST) + "/api?apikey=" + str(mylar.SAB_APIKEY)
|
tmpapi = mylar.SAB_HOST + "/api?apikey=" + mylar.SAB_APIKEY
|
||||||
|
|
||||||
logger.fdebug("send-to-SAB host &api initiation string : " + str(helpers.apiremove(tmpapi,'&')))
|
logger.fdebug("send-to-SAB host &api initiation string : " + str(helpers.apiremove(tmpapi,'&')))
|
||||||
|
|
||||||
fileURL = str(linkapi)
|
fileURL = urllib.quote_plus(linkapi)
|
||||||
|
|
||||||
SABtype = "&mode=addurl&name="
|
SABtype = "&mode=addurl&name="
|
||||||
tmpapi = tmpapi + str(SABtype)
|
tmpapi = tmpapi + SABtype
|
||||||
|
|
||||||
logger.fdebug("...selecting API type: " + str(tmpapi))
|
logger.fdebug("...selecting API type: " + str(tmpapi))
|
||||||
tmpapi = tmpapi + str(fileURL)
|
tmpapi = tmpapi + fileURL
|
||||||
|
|
||||||
logger.fdebug("...attaching nzb provider link: " + str(helpers.apiremove(tmpapi,'$')))
|
logger.fdebug("...attaching nzb provider link: " + str(helpers.apiremove(tmpapi,'$')))
|
||||||
# determine SAB priority
|
# determine SAB priority
|
||||||
if mylar.SAB_PRIORITY:
|
if mylar.SAB_PRIORITY:
|
||||||
tmpapi = tmpapi + "&priority=" + str(sabpriority)
|
tmpapi = tmpapi + "&priority=" + sabpriority
|
||||||
logger.fdebug("...setting priority: " + str(helpers.apiremove(tmpapi,'&')))
|
logger.fdebug("...setting priority: " + str(helpers.apiremove(tmpapi,'&')))
|
||||||
# if category is blank, let's adjust
|
# if category is blank, let's adjust
|
||||||
if mylar.SAB_CATEGORY:
|
if mylar.SAB_CATEGORY:
|
||||||
tmpapi = tmpapi + "&cat=" + str(mylar.SAB_CATEGORY)
|
tmpapi = tmpapi + "&cat=" + mylar.SAB_CATEGORY
|
||||||
logger.fdebug("...attaching category: " + str(helpers.apiremove(tmpapi,'&')))
|
logger.fdebug("...attaching category: " + str(helpers.apiremove(tmpapi,'&')))
|
||||||
if mylar.POST_PROCESSING: #or mylar.RENAME_FILES:
|
if mylar.POST_PROCESSING: #or mylar.RENAME_FILES:
|
||||||
if mylar.POST_PROCESSING_SCRIPT:
|
if mylar.POST_PROCESSING_SCRIPT:
|
||||||
|
|
Loading…
Add table
Reference in a new issue