From e39ede3683272b784d2033c9d3e09402d3e862b8 Mon Sep 17 00:00:00 2001 From: Ruud Burger Date: Thu, 18 Aug 2016 17:25:30 +0200 Subject: [PATCH] Added Trusted only torrents option to TPB --- .../core/media/_base/providers/torrent/thepiratebay.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/couchpotato/core/media/_base/providers/torrent/thepiratebay.py b/couchpotato/core/media/_base/providers/torrent/thepiratebay.py index 691baa3..4cd180b 100644 --- a/couchpotato/core/media/_base/providers/torrent/thepiratebay.py +++ b/couchpotato/core/media/_base/providers/torrent/thepiratebay.py @@ -101,6 +101,13 @@ class Base(TorrentMagnetProvider): continue if link and download: + if self.conf('trusted_only'): + if result.find('img', alt = re.compile('Trusted')) is None and \ + result.find('img', alt = re.compile('VIP')) is None and \ + result.find('img', alt = re.compile('Helpers')) is None and \ + result.find('img', alt = re.compile('Moderator')) is None: + log.info('Skipped torrent %s, untrusted.' % link.string) + continue def extra_score(item): trusted = (0, 10)[result.find('img', alt = re.compile('Trusted')) is not None] @@ -200,6 +207,14 @@ config = [{ 'type': 'int', 'default': 0, 'description': 'Starting score for each release found via this provider.', + }, + { + 'name': 'trusted_only', + 'advanced': True, + 'label': 'Trusted/VIP Only', + 'type': 'bool', + 'default': False, + 'description': 'Only download releases marked as Trusted or VIP' } ], }