From ca070e67e72c5708ebcff51c8fa3c569f6f2c0ad Mon Sep 17 00:00:00 2001 From: coolius Date: Mon, 2 Dec 2013 10:53:47 +0000 Subject: [PATCH 1/5] Updated YIFY provider to use proxy and magnet links --- couchpotato/core/providers/torrent/yify/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/couchpotato/core/providers/torrent/yify/main.py b/couchpotato/core/providers/torrent/yify/main.py index 60b2f9b1..3cb83bb1 100644 --- a/couchpotato/core/providers/torrent/yify/main.py +++ b/couchpotato/core/providers/torrent/yify/main.py @@ -1,17 +1,17 @@ from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog -from couchpotato.core.providers.torrent.base import TorrentProvider +from couchpotato.core.providers.torrent.base import TorrentMagnetProvider import traceback log = CPLog(__name__) -class Yify(TorrentProvider): +class Yify(TorrentMagnetProvider): urls = { - 'test' : 'https://yify-torrents.com/api', - 'search' : 'https://yify-torrents.com/api/list.json?keywords=%s&quality=%s', - 'detail': 'https://yify-torrents.com/api/movie.json?id=%s' + 'test' : 'http://yify.ftwnet.co.uk/api', + 'search' : 'http://yify.ftwnet.co.uk/api/list.json?keywords=%s&quality=%s', + 'detail': 'http://yify.ftwnet.co.uk/api/movie.json?id=%s' } http_time_between_calls = 1 #seconds @@ -41,7 +41,7 @@ class Yify(TorrentProvider): results.append({ 'id': result['MovieID'], 'name': title, - 'url': result['TorrentUrl'], + 'url': result['TorrentMagnetUrl'], 'detail_url': self.urls['detail'] % result['MovieID'], 'size': self.parseSize(result['Size']), 'seeders': tryInt(result['TorrentSeeds']), From 732946d38a21cfc671f05525b6ae1c25fc2161ea Mon Sep 17 00:00:00 2001 From: coolius Date: Tue, 3 Dec 2013 10:08:14 +0000 Subject: [PATCH 2/5] Updated YIFY provider to use proxy list --- .../core/providers/torrent/yify/main.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/couchpotato/core/providers/torrent/yify/main.py b/couchpotato/core/providers/torrent/yify/main.py index 3cb83bb1..ea6d7870 100644 --- a/couchpotato/core/providers/torrent/yify/main.py +++ b/couchpotato/core/providers/torrent/yify/main.py @@ -9,12 +9,20 @@ log = CPLog(__name__) class Yify(TorrentMagnetProvider): urls = { - 'test' : 'http://yify.ftwnet.co.uk/api', - 'search' : 'http://yify.ftwnet.co.uk/api/list.json?keywords=%s&quality=%s', - 'detail': 'http://yify.ftwnet.co.uk/api/movie.json?id=%s' + 'test' : '%s/api', + 'search' : '%s/api/list.json?keywords=%s&quality=%s', + 'detail': '%s/api/movie.json?id=%s' } http_time_between_calls = 1 #seconds + + proxy_list = [ + 'https://yify-torrents.com', + 'http://yify.unlocktorrent.com', + 'http://yify.ftwnet.co.uk', + 'http://yify-torrents.com.come.in', + 'http://yify-torrents.com.prx2.unblocksit.es', + ] def search(self, movie, quality): @@ -25,7 +33,9 @@ class Yify(TorrentMagnetProvider): def _search(self, movie, quality, results): - data = self.getJsonData(self.urls['search'] % (movie['library']['identifier'], quality['identifier'])) + search_url = self.urls['search'] % (self.getDomain(), movie['library']['identifier'], quality['identifier']) + + data = self.getJsonData(search_url) if data and data.get('MovieList'): try: @@ -42,7 +52,7 @@ class Yify(TorrentMagnetProvider): 'id': result['MovieID'], 'name': title, 'url': result['TorrentMagnetUrl'], - 'detail_url': self.urls['detail'] % result['MovieID'], + 'detail_url': self.urls['detail'] % (self.getDomain(),result['MovieID']), 'size': self.parseSize(result['Size']), 'seeders': tryInt(result['TorrentSeeds']), 'leechers': tryInt(result['TorrentPeers']) @@ -51,3 +61,5 @@ class Yify(TorrentMagnetProvider): except: log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc())) + def correctProxy(self, data): + return 'title="YIFY-Torrents RSS feed"' in data From 9dd98b29bef082c122496247d35909d686253811 Mon Sep 17 00:00:00 2001 From: coolius Date: Tue, 3 Dec 2013 10:32:10 +0000 Subject: [PATCH 3/5] Added proxy options to YIFY provider --- couchpotato/core/providers/torrent/yify/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/couchpotato/core/providers/torrent/yify/__init__.py b/couchpotato/core/providers/torrent/yify/__init__.py index 775ecdbe..99c1162e 100644 --- a/couchpotato/core/providers/torrent/yify/__init__.py +++ b/couchpotato/core/providers/torrent/yify/__init__.py @@ -18,6 +18,12 @@ config = [{ 'type': 'enabler', 'default': 0 }, + { + 'name': 'domain', + 'advanced': True, + 'label': 'Proxy server', + 'description': 'Domain for requests, keep empty to let CouchPotato pick.', + }, { 'name': 'seed_ratio', 'label': 'Seed ratio', From 4eaddadf8cc6013771257e1fb62a85a031d32a99 Mon Sep 17 00:00:00 2001 From: coolius Date: Wed, 4 Dec 2013 13:50:06 +0000 Subject: [PATCH 4/5] Removed unusable proxy --- couchpotato/core/providers/torrent/yify/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/couchpotato/core/providers/torrent/yify/main.py b/couchpotato/core/providers/torrent/yify/main.py index ea6d7870..f23b6d46 100644 --- a/couchpotato/core/providers/torrent/yify/main.py +++ b/couchpotato/core/providers/torrent/yify/main.py @@ -21,7 +21,6 @@ class Yify(TorrentMagnetProvider): 'http://yify.unlocktorrent.com', 'http://yify.ftwnet.co.uk', 'http://yify-torrents.com.come.in', - 'http://yify-torrents.com.prx2.unblocksit.es', ] def search(self, movie, quality): From 138a3b1f3cf8a085061fa978a247d5b419611970 Mon Sep 17 00:00:00 2001 From: coolius Date: Mon, 16 Dec 2013 09:21:59 +0000 Subject: [PATCH 5/5] Replaced default YIFY URL with official alternate domain "yify-torrents.im" --- couchpotato/core/providers/torrent/yify/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couchpotato/core/providers/torrent/yify/main.py b/couchpotato/core/providers/torrent/yify/main.py index f23b6d46..0b5e8b87 100644 --- a/couchpotato/core/providers/torrent/yify/main.py +++ b/couchpotato/core/providers/torrent/yify/main.py @@ -17,7 +17,7 @@ class Yify(TorrentMagnetProvider): http_time_between_calls = 1 #seconds proxy_list = [ - 'https://yify-torrents.com', + 'https://yify-torrents.im', 'http://yify.unlocktorrent.com', 'http://yify.ftwnet.co.uk', 'http://yify-torrents.com.come.in',