Skip to content

Commit

Permalink
fix for seeder sort with Orpheus
Browse files Browse the repository at this point in the history
  • Loading branch information
nopoz committed Nov 8, 2018
1 parent d1237b0 commit 81486d2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions headphones/searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,6 @@ def sort_search_results(resultlist, album, new, albumlength):

finallist = sorted(newlist, key=lambda title: (-title[5], title[6]))

# keep number of seeders order for Orpheus.network
if result[3] == 'Orpheus.network':
finallist = resultlist

if not len(finallist) and len(
flac_list) and headphones.CONFIG.PREFERRED_BITRATE_ALLOW_LOSSLESS:
logger.info(
Expand All @@ -490,6 +486,10 @@ def sort_search_results(resultlist, album, new, albumlength):
else:

finallist = sorted(resultlist, key=lambda title: (title[5], int(title[1])), reverse=True)

# keep number of seeders order for Orpheus.network
if result[3] == 'Orpheus.network':
finallist = resultlist

if not len(finallist):
logger.info('No appropriate matches found for %s - %s', album['ArtistName'],
Expand Down Expand Up @@ -1929,8 +1929,7 @@ def preprocess(resultlist):
elif result[3] == 'Redacted':
headers['User-Agent'] = 'Headphones'
elif result[3] == "The Pirate Bay" or result[3] == "Old Pirate Bay":
headers[
'User-Agent'] = 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2243.2 Safari/537.36'
headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2243.2 Safari/537.36'

# Jackett sometimes redirects to a magnet URI
if result[3].startswith('Jackett_') or 'torznab' in result[3].lower():
Expand Down

0 comments on commit 81486d2

Please sign in to comment.