From 81486d2cd2c61877f5b0a458dd6978f913b05eca Mon Sep 17 00:00:00 2001 From: doucheymcdoucherson Date: Thu, 8 Nov 2018 11:41:33 -0800 Subject: [PATCH] fix for seeder sort with Orpheus --- headphones/searcher.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index 59ec31345..4ab1fadb8 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -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( @@ -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'], @@ -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():