mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-21 08:24:00 +01:00
Merge remote-tracking branch 'coolbombom/master' into develop
This commit is contained in:
+12
-5
@@ -1073,9 +1073,7 @@ def searchTorrent(albumid=None, new=False, losslessOnly=False):
|
|||||||
provider))
|
provider))
|
||||||
|
|
||||||
# Pirate Bay
|
# Pirate Bay
|
||||||
if headphones.PIRATEBAY and headphones.TORRENT_DOWNLOADER == 0:
|
if headphones.PIRATEBAY:
|
||||||
logger.warn("Cannot search Pirate Bay with Blackhole option set")
|
|
||||||
if headphones.PIRATEBAY and headphones.TORRENT_DOWNLOADER != 0:
|
|
||||||
provider = "The Pirate Bay"
|
provider = "The Pirate Bay"
|
||||||
providerurl = url_fix("http://thepiratebay.sx/search/" + term + "/0/99/")
|
providerurl = url_fix("http://thepiratebay.sx/search/" + term + "/0/99/")
|
||||||
if headphones.PREFERRED_QUALITY == 3 or losslessOnly:
|
if headphones.PREFERRED_QUALITY == 3 or losslessOnly:
|
||||||
@@ -1117,9 +1115,15 @@ def searchTorrent(albumid=None, new=False, losslessOnly=False):
|
|||||||
title = ''.join(item.find("a", {"class" : "detLink"}))
|
title = ''.join(item.find("a", {"class" : "detLink"}))
|
||||||
seeds = int(''.join(item.find("td", {"align" : "right"})))
|
seeds = int(''.join(item.find("td", {"align" : "right"})))
|
||||||
url = item.findAll("a")[3]['href']
|
url = item.findAll("a")[3]['href']
|
||||||
|
if headphones.TORRENT_DOWNLOADER == 0:
|
||||||
|
tor_hash = re.findall("urn:btih:(.*?)&", url)
|
||||||
|
if len(tor_hash) > 0:
|
||||||
|
url = "http://torrage.com/torrent/"+str(tor_hash[0]).upper()+".torrent"
|
||||||
|
else:
|
||||||
|
url = None
|
||||||
formatted_size = re.search('Size (.*),', unicode(item)).group(1).replace(u'\xa0', ' ')
|
formatted_size = re.search('Size (.*),', unicode(item)).group(1).replace(u'\xa0', ' ')
|
||||||
size = helpers.piratesize(formatted_size)
|
size = helpers.piratesize(formatted_size)
|
||||||
if size < maxsize and minimumseeders < seeds:
|
if size < maxsize and minimumseeders < seeds and url != None:
|
||||||
resultlist.append((title, size, url, provider))
|
resultlist.append((title, size, url, provider))
|
||||||
logger.info('Found %s. Size: %s' % (title, formatted_size))
|
logger.info('Found %s. Size: %s' % (title, formatted_size))
|
||||||
else:
|
else:
|
||||||
@@ -1193,6 +1197,9 @@ def searchTorrent(albumid=None, new=False, losslessOnly=False):
|
|||||||
rightformat = False
|
rightformat = False
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
rightformat = False
|
rightformat = False
|
||||||
|
for findterm in term.split(" "):
|
||||||
|
if not findterm in title:
|
||||||
|
rightformat = False
|
||||||
if rightformat == True and size < maxsize and minimumseeders < seeds:
|
if rightformat == True and size < maxsize and minimumseeders < seeds:
|
||||||
resultlist.append((title, size, url, provider))
|
resultlist.append((title, size, url, provider))
|
||||||
logger.info('Found %s. Size: %s' % (title, helpers.bytes_to_mb(size)))
|
logger.info('Found %s. Size: %s' % (title, helpers.bytes_to_mb(size)))
|
||||||
@@ -1454,7 +1461,7 @@ def preprocesstorrent(resultlist, pre_sorted_list=False):
|
|||||||
for result in resultlist:
|
for result in resultlist:
|
||||||
|
|
||||||
# get outta here if rutracker or piratebay
|
# get outta here if rutracker or piratebay
|
||||||
if result[3] == 'rutracker.org' or result[3] == 'The Pirate Bay':
|
if result[3] == 'rutracker.org':
|
||||||
return True, result
|
return True, result
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user