Updated YIFY provider to use proxies and magnet links, #2560 (manuall merge)
This commit is contained in:
1 parent
0b01bbc52e
commit
787405ae62
2 files changed
+25
-8
No files matched your search
@@ -18,6 +18,12 @@ config = [{
|
|||||||
'type': 'enabler',
|
'type': 'enabler',
|
||||||
'default': 0
|
'default': 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'domain',
|
||||||
|
'advanced': True,
|
||||||
|
'label': 'Proxy server',
|
||||||
|
'description': 'Domain for requests, keep empty to let CouchPotato pick.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': 'seed_ratio',
|
'name': 'seed_ratio',
|
||||||
'label': 'Seed ratio',
|
'label': 'Seed ratio',
|
||||||
|
|||||||
@@ -1,20 +1,27 @@
|
|||||||
from couchpotato.core.helpers.variable import tryInt
|
from couchpotato.core.helpers.variable import tryInt
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
from couchpotato.core.providers.torrent.base import TorrentProvider
|
from couchpotato.core.providers.torrent.base import TorrentMagnetProvider
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
log = CPLog(__name__)
|
log = CPLog(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Yify(TorrentProvider):
|
class Yify(TorrentMagnetProvider):
|
||||||
|
|
||||||
urls = {
|
urls = {
|
||||||
'test' : 'https://yify-torrents.com/api',
|
'test' : '%s/api',
|
||||||
'search' : 'https://yify-torrents.com/api/list.json?keywords=%s&quality=%s',
|
'search' : '%s/api/list.json?keywords=%s&quality=%s',
|
||||||
'detail': 'https://yify-torrents.com/api/movie.json?id=%s'
|
'detail': '%s/api/movie.json?id=%s'
|
||||||
}
|
}
|
||||||
|
|
||||||
http_time_between_calls = 1 #seconds
|
http_time_between_calls = 1 #seconds
|
||||||
|
|
||||||
|
proxy_list = [
|
||||||
|
'https://yify-torrents.im',
|
||||||
|
'http://yify.unlocktorrent.com',
|
||||||
|
'http://yify.ftwnet.co.uk',
|
||||||
|
'http://yify-torrents.com.come.in',
|
||||||
|
]
|
||||||
|
|
||||||
def search(self, movie, quality):
|
def search(self, movie, quality):
|
||||||
|
|
||||||
@@ -25,7 +32,9 @@ class Yify(TorrentProvider):
|
|||||||
|
|
||||||
def _search(self, movie, quality, results):
|
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'):
|
if data and data.get('MovieList'):
|
||||||
try:
|
try:
|
||||||
@@ -41,8 +50,8 @@ class Yify(TorrentProvider):
|
|||||||
results.append({
|
results.append({
|
||||||
'id': result['MovieID'],
|
'id': result['MovieID'],
|
||||||
'name': title,
|
'name': title,
|
||||||
'url': result['TorrentUrl'],
|
'url': result['TorrentMagnetUrl'],
|
||||||
'detail_url': self.urls['detail'] % result['MovieID'],
|
'detail_url': self.urls['detail'] % (self.getDomain(),result['MovieID']),
|
||||||
'size': self.parseSize(result['Size']),
|
'size': self.parseSize(result['Size']),
|
||||||
'seeders': tryInt(result['TorrentSeeds']),
|
'seeders': tryInt(result['TorrentSeeds']),
|
||||||
'leechers': tryInt(result['TorrentPeers'])
|
'leechers': tryInt(result['TorrentPeers'])
|
||||||
@@ -51,3 +60,5 @@ class Yify(TorrentProvider):
|
|||||||
except:
|
except:
|
||||||
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
|
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
|
||||||
Reference in new issue
Block a user