From 9225c84016ec153459512c1d90be85b2774153d8 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Mon, 19 Mar 2018 13:11:25 +0000 Subject: [PATCH] Change remove dead tor caches and stop searching episodes that have a magnet saved. Change AlphaRatio provider freeleech mode; prevent spoiling user ratio from ambiguous filtered results. The AR "Freeleech" search filter has changed to additionally return "Timed" and "Expired" freeleech items. However, this change makes results ambiguous to the point that a ratio can be ruined if an item snatched is expired or expiring. Therefore, when freeleech mode is active for this provider, all except pure *freeleech* items are discarded from results. --- CHANGES.md | 7 ++++++- sickbeard/providers/alpharatio.py | 6 +++++- sickbeard/providers/generic.py | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1ab0a2e3..a4c683a7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 0.14.8 (2018-03-13 22:00:00 UTC) +### 0.14.9 (2018-03-19 13:10:00 UTC) + +Change remove dead tor caches and stop searching episodes that have a magnet saved +Change AlphaRatio provider freeleech mode; prevent spoiling user ratio from ambiguous filtered results + +### 0.14.8 (2018-03-13 22:00:00 UTC) Fix changing status from "Skipped" to "Wanted" in Manage/Episode Status diff --git a/sickbeard/providers/alpharatio.py b/sickbeard/providers/alpharatio.py index 1d35cd59..0cec5b25 100644 --- a/sickbeard/providers/alpharatio.py +++ b/sickbeard/providers/alpharatio.py @@ -89,7 +89,11 @@ class AlphaRatioProvider(generic.TorrentProvider): head = head if None is not head else self._header_row(tr) seeders, leechers, size = [tryInt(n, n) for n in [ cells[head[x]].get_text().strip() for x in 'seed', 'leech', 'size']] - if self._peers_fail(mode, seeders, leechers): + if self._peers_fail(mode, seeders, leechers) or \ + (self.freeleech and + any([not tr.select('.tl_free'), + tr.select('.tl_timed'), tr.select('[title^="Timed Free"]'), + tr.select('.tl_expired'), tr.select('[title^="Expired Free"]')])): continue title = tr.find('a', title=rc['info']).get_text().strip() diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 1a20c138..ef11a782 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -640,7 +640,7 @@ class GenericProvider(object): urls = ['http%s://%s/torrent/%s.torrent' % (u + (btih.upper(),)) for u in (('s', 'itorrents.org'), ('s', 'torrage.info'), ('', 'reflektor.karmorra.info'), - ('s', 'torrentproject.se'), ('', 'thetorrent.org'), ('s', 'torcache.to'))] + ('', 'thetorrent.org'))] except (StandardError, Exception): link_type = 'torrent' urls = [result.url] @@ -695,6 +695,7 @@ class GenericProvider(object): fp.write(result.url) fp.flush() os.fsync(fp.fileno()) + saved = True logger.log(u'Saved magnet link to file as some clients (or plugins) support this, %s' % final_file) if 'blackhole' == sickbeard.TORRENT_METHOD: logger.log('Tip: If your client fails to load magnet in files, ' +