mirror of
https://github.com/evilhero/mylar
synced 2025-03-09 21:33:42 +00:00
FIX: if CBT and KAT both enabled, would only use CBT for searches, FIX: Added extra URL for KAT to include Other category when indexing RSS / searching (increase 0-day hits)
This commit is contained in:
parent
4c2ec769d1
commit
10f797c9b7
2 changed files with 104 additions and 65 deletions
|
@ -40,6 +40,7 @@ def tehMain(forcerss=None):
|
||||||
if mylar.ENABLE_KAT:
|
if mylar.ENABLE_KAT:
|
||||||
logger.fdebug('[RSS] Initiating Torrent RSS Feed Check on KAT.')
|
logger.fdebug('[RSS] Initiating Torrent RSS Feed Check on KAT.')
|
||||||
torrents(pickfeed='3')
|
torrents(pickfeed='3')
|
||||||
|
torrents(pickfeed='6')
|
||||||
if mylar.ENABLE_CBT:
|
if mylar.ENABLE_CBT:
|
||||||
logger.fdebug('[RSS] Initiating Torrent RSS Feed Check on CBT.')
|
logger.fdebug('[RSS] Initiating Torrent RSS Feed Check on CBT.')
|
||||||
torrents(pickfeed='1')
|
torrents(pickfeed='1')
|
||||||
|
@ -79,32 +80,18 @@ def torrents(pickfeed=None,seriesname=None,issue=None):
|
||||||
else:
|
else:
|
||||||
kat_url = 'http://kat.ph/'
|
kat_url = 'http://kat.ph/'
|
||||||
|
|
||||||
|
if pickfeed == 'KAT':
|
||||||
if pickfeed == "1": # cbt rss feed based on followlist
|
#we need to cycle through both categories (comics & other) - so we loop.
|
||||||
feed = "http://comicbt.com/rss.php?action=browse&passkey=" + str(passkey) + "&type=dl"
|
loopit = 2
|
||||||
elif pickfeed == "2" and srchterm is not None: # kat.ph search
|
|
||||||
feed = kat_url + "usearch/" + str(srchterm) + "%20category%3Acomics%20seeds%3A1/?rss=1"
|
|
||||||
elif pickfeed == "3": # kat.ph rss feed
|
|
||||||
feed = kat_url + "usearch/category%3Acomics%20seeds%3A1/?rss=1"
|
|
||||||
elif pickfeed == "4": #cbt follow link
|
|
||||||
feed = "http://comicbt.com/rss.php?action=follow&passkey=" + str(passkey) + "&type=dl"
|
|
||||||
elif pickfeed == "5": # cbt series link
|
|
||||||
# seriespage = "http://comicbt.com/series.php?passkey=" + str(passkey)
|
|
||||||
feed = "http://comicbt.com/rss.php?action=series&series=" + str(seriesno) + "&passkey=" + str(passkey)
|
|
||||||
else:
|
else:
|
||||||
logger.error('invalid pickfeed denoted...')
|
loopit = 1
|
||||||
return
|
|
||||||
|
lp = 0
|
||||||
|
|
||||||
title = []
|
title = []
|
||||||
link = []
|
link = []
|
||||||
description = []
|
description = []
|
||||||
seriestitle = []
|
seriestitle = []
|
||||||
|
|
||||||
if pickfeed == "5": # we need to get the series # first
|
|
||||||
seriesSearch(seriespage, seriesname)
|
|
||||||
|
|
||||||
feedme = feedparser.parse(feed)
|
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
feeddata = []
|
feeddata = []
|
||||||
|
@ -112,48 +99,99 @@ def torrents(pickfeed=None,seriesname=None,issue=None):
|
||||||
torthekat = []
|
torthekat = []
|
||||||
katinfo = {}
|
katinfo = {}
|
||||||
|
|
||||||
for entry in feedme['entries']:
|
while (lp < loopit):
|
||||||
if pickfeed == "3":
|
if lp == 0 and loopit == 2:
|
||||||
tmpsz = feedme.entries[i].enclosures[0]
|
pickfeed = '2'
|
||||||
feeddata.append({
|
elif lp == 1 and loopit == 2:
|
||||||
'Site': 'KAT',
|
pickfeed = '5'
|
||||||
'Title': feedme.entries[i].title,
|
|
||||||
'Link': tmpsz['url'],
|
|
||||||
'Pubdate': feedme.entries[i].updated,
|
|
||||||
'Size': tmpsz['length']
|
|
||||||
})
|
|
||||||
|
|
||||||
elif pickfeed == "2":
|
feedtype = None
|
||||||
tmpsz = feedme.entries[i].enclosures[0]
|
|
||||||
torthekat.append({
|
|
||||||
'site': 'KAT',
|
|
||||||
'title': feedme.entries[i].title,
|
|
||||||
'link': tmpsz['url'],
|
|
||||||
'pubdate': feedme.entries[i].updated,
|
|
||||||
'length': tmpsz['length']
|
|
||||||
})
|
|
||||||
|
|
||||||
#print ("Site: KAT")
|
if pickfeed == "1": # cbt rss feed based on followlist
|
||||||
#print ("Title: " + str(feedme.entries[i].title))
|
feed = "http://comicbt.com/rss.php?action=browse&passkey=" + str(passkey) + "&type=dl"
|
||||||
#print ("Link: " + str(tmpsz['url']))
|
feedtype = ' from the New Releases RSS Feed for comics'
|
||||||
#print ("pubdate: " + str(feedme.entries[i].updated))
|
elif pickfeed == "2" and srchterm is not None: # kat.ph search
|
||||||
#print ("size: " + str(tmpsz['length']))
|
feed = kat_url + "usearch/" + str(srchterm) + "%20category%3Acomics%20seeds%3A1/?rss=1"
|
||||||
|
elif pickfeed == "3": # kat.ph rss feed
|
||||||
|
feed = kat_url + "usearch/category%3Acomics%20seeds%3A1/?rss=1"
|
||||||
|
feedtype = ' from the New Releases RSS Feed for comics'
|
||||||
|
elif pickfeed == "4": #cbt follow link
|
||||||
|
feed = "http://comicbt.com/rss.php?action=follow&passkey=" + str(passkey) + "&type=dl"
|
||||||
|
feedtype = ' from your CBT Followlist RSS Feed'
|
||||||
|
elif pickfeed == "5" and srchterm is not None: # kat.ph search (category:other since some 0-day comics initially get thrown there until categorized)
|
||||||
|
feed = kat_url + "usearch/" + str(srchterm) + "%20category%3Aother%20seeds%3A1/?rss=1"
|
||||||
|
elif pickfeed == "6": # kat.ph rss feed (category:other so that we can get them quicker if need-be)
|
||||||
|
feed = kat_url + "usearch/.cbr%20category%3Aother%20seeds%3A1/?rss=1"
|
||||||
|
feedtype = ' from the New Releases for category Other RSS Feed that contain comics'
|
||||||
|
elif pickfeed == "7": # cbt series link
|
||||||
|
# seriespage = "http://comicbt.com/series.php?passkey=" + str(passkey)
|
||||||
|
feed = "http://comicbt.com/rss.php?action=series&series=" + str(seriesno) + "&passkey=" + str(passkey)
|
||||||
|
else:
|
||||||
|
logger.error('invalid pickfeed denoted...')
|
||||||
|
return
|
||||||
|
|
||||||
|
#print 'feed URL: ' + str(feed)
|
||||||
|
|
||||||
|
if pickfeed == "7": # we need to get the series # first
|
||||||
|
seriesSearch(seriespage, seriesname)
|
||||||
|
|
||||||
|
feedme = feedparser.parse(feed)
|
||||||
|
|
||||||
|
if pickfeed == "3" or pickfeed == "6" or pickfeed == "2" or pickfeed == "5":
|
||||||
|
picksite = 'KAT'
|
||||||
elif pickfeed == "1" or pickfeed == "4":
|
elif pickfeed == "1" or pickfeed == "4":
|
||||||
# tmpsz = feedme.entries[i].enclosures[0]
|
picksite = 'CBT'
|
||||||
feeddata.append({
|
|
||||||
'Site': 'CBT',
|
for entry in feedme['entries']:
|
||||||
'Title': feedme.entries[i].title,
|
if pickfeed == "3" or pickfeed == "6":
|
||||||
'Link': feedme.entries[i].link,
|
tmpsz = feedme.entries[i].enclosures[0]
|
||||||
'Pubdate': feedme.entries[i].updated
|
feeddata.append({
|
||||||
# 'Size': tmpsz['length']
|
'Site': picksite,
|
||||||
})
|
'Title': feedme.entries[i].title,
|
||||||
#print ("Site: CBT")
|
'Link': tmpsz['url'],
|
||||||
#print ("Title: " + str(feeddata[i]['Title']))
|
'Pubdate': feedme.entries[i].updated,
|
||||||
#print ("Link: " + str(feeddata[i]['Link']))
|
'Size': tmpsz['length']
|
||||||
#print ("pubdate: " + str(feeddata[i]['Pubdate']))
|
})
|
||||||
i+=1
|
|
||||||
logger.fdebug('there were ' + str(i) + ' results..')
|
elif pickfeed == "2" or pickfeed == "5":
|
||||||
|
tmpsz = feedme.entries[i].enclosures[0]
|
||||||
|
torthekat.append({
|
||||||
|
'site': picksite,
|
||||||
|
'title': feedme.entries[i].title,
|
||||||
|
'link': tmpsz['url'],
|
||||||
|
'pubdate': feedme.entries[i].updated,
|
||||||
|
'length': tmpsz['length']
|
||||||
|
})
|
||||||
|
|
||||||
|
#print ("Site: KAT")
|
||||||
|
#print ("Title: " + str(feedme.entries[i].title))
|
||||||
|
#print ("Link: " + str(tmpsz['url']))
|
||||||
|
#print ("pubdate: " + str(feedme.entries[i].updated))
|
||||||
|
#print ("size: " + str(tmpsz['length']))
|
||||||
|
|
||||||
|
elif pickfeed == "1" or pickfeed == "4":
|
||||||
|
# tmpsz = feedme.entries[i].enclosures[0]
|
||||||
|
feeddata.append({
|
||||||
|
'Site': picksite,
|
||||||
|
'Title': feedme.entries[i].title,
|
||||||
|
'Link': feedme.entries[i].link,
|
||||||
|
'Pubdate': feedme.entries[i].updated
|
||||||
|
# 'Size': tmpsz['length']
|
||||||
|
})
|
||||||
|
#print ("Site: CBT")
|
||||||
|
#print ("Title: " + str(feeddata[i]['Title']))
|
||||||
|
#print ("Link: " + str(feeddata[i]['Link']))
|
||||||
|
#print ("pubdate: " + str(feeddata[i]['Pubdate']))
|
||||||
|
|
||||||
|
|
||||||
|
i+=1
|
||||||
|
|
||||||
|
if feedtype is None:
|
||||||
|
logger.fdebug('[' + picksite + '] there were ' + str(i) + ' results..')
|
||||||
|
else:
|
||||||
|
logger.fdebug('[' + picksite + '] there were ' + str(i) + ' results ' + feedtype)
|
||||||
|
lp +=1
|
||||||
|
|
||||||
|
|
||||||
if not seriesname:
|
if not seriesname:
|
||||||
rssdbupdate(feeddata,i,'torrent')
|
rssdbupdate(feeddata,i,'torrent')
|
||||||
|
@ -192,7 +230,7 @@ def nzbs(provider=None):
|
||||||
|
|
||||||
# --------
|
# --------
|
||||||
providercount = int(nzbp + newznabs)
|
providercount = int(nzbp + newznabs)
|
||||||
logger.fdebug('there are : ' + str(providercount) + ' RSS search providers you have enabled.')
|
logger.fdebug('there are : ' + str(providercount) + ' nzb RSS search providers you have enabled.')
|
||||||
nzbpr = providercount - 1
|
nzbpr = providercount - 1
|
||||||
if nzbpr < 0:
|
if nzbpr < 0:
|
||||||
nzbpr == 0
|
nzbpr == 0
|
||||||
|
@ -325,10 +363,11 @@ def nzbs(provider=None):
|
||||||
#logger.fdebug("pubdate: " + str(feeddata[i]['Pubdate']))
|
#logger.fdebug("pubdate: " + str(feeddata[i]['Pubdate']))
|
||||||
#logger.fdebug("size: " + str(feeddata[i]['Size']))
|
#logger.fdebug("size: " + str(feeddata[i]['Size']))
|
||||||
sitei+=1
|
sitei+=1
|
||||||
logger.info(str(site) + ' : ' + str(sitei) + ' entries indexed.')
|
logger.info('[' + str(site) + '] ' + str(sitei) + ' entries indexed.')
|
||||||
i+=sitei
|
i+=sitei
|
||||||
logger.info('[RSS] ' + str(i) + ' entries have been indexed and are now going to be stored for caching.')
|
if i > 0:
|
||||||
rssdbupdate(feeddata,i,'usenet')
|
logger.info('[RSS] ' + str(i) + ' entries have been indexed and are now going to be stored for caching.')
|
||||||
|
rssdbupdate(feeddata,i,'usenet')
|
||||||
return
|
return
|
||||||
|
|
||||||
def rssdbupdate(feeddata,i,type):
|
def rssdbupdate(feeddata,i,type):
|
||||||
|
|
|
@ -67,7 +67,7 @@ def search_init(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueD
|
||||||
torprovider.append('cbt')
|
torprovider.append('cbt')
|
||||||
torp+=1
|
torp+=1
|
||||||
#print torprovider[0]
|
#print torprovider[0]
|
||||||
elif mylar.ENABLE_KAT:
|
if mylar.ENABLE_KAT:
|
||||||
torprovider.append('kat')
|
torprovider.append('kat')
|
||||||
torp+=1
|
torp+=1
|
||||||
##nzb provider selection##
|
##nzb provider selection##
|
||||||
|
@ -113,7 +113,7 @@ def search_init(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueD
|
||||||
if torpr < 0:
|
if torpr < 0:
|
||||||
torpr = -1
|
torpr = -1
|
||||||
providercount = int(nzbp + newznabs)
|
providercount = int(nzbp + newznabs)
|
||||||
logger.fdebug("there are : " + str(providercount) + " search providers you have selected.")
|
logger.fdebug("there are : " + str(providercount) + " nzb providers you have selected.")
|
||||||
logger.fdebug("Usenet Retention : " + str(mylar.USENET_RETENTION) + " days")
|
logger.fdebug("Usenet Retention : " + str(mylar.USENET_RETENTION) + " days")
|
||||||
nzbpr = providercount - 1
|
nzbpr = providercount - 1
|
||||||
if nzbpr < 0:
|
if nzbpr < 0:
|
||||||
|
@ -586,7 +586,7 @@ def NZB_SEARCH(ComicName, IssueNumber, ComicYear, SeriesYear, Publisher, IssueDa
|
||||||
elif nzbprov == 'KAT':
|
elif nzbprov == 'KAT':
|
||||||
cmname = re.sub("%20", " ", str(comsrc))
|
cmname = re.sub("%20", " ", str(comsrc))
|
||||||
logger.fdebug("Sending request to [KAT] for " + str(cmname) + " : " + str(mod_isssearch))
|
logger.fdebug("Sending request to [KAT] for " + str(cmname) + " : " + str(mod_isssearch))
|
||||||
bb = rsscheck.torrents(pickfeed='2',seriesname=cmname,issue=mod_isssearch)
|
bb = rsscheck.torrents(pickfeed='KAT',seriesname=cmname,issue=mod_isssearch)
|
||||||
rss = "no"
|
rss = "no"
|
||||||
#if bb is not None: logger.fdebug("results: " + str(bb))
|
#if bb is not None: logger.fdebug("results: " + str(bb))
|
||||||
elif nzbprov != 'experimental':
|
elif nzbprov != 'experimental':
|
||||||
|
|
Loading…
Add table
Reference in a new issue