Fix Yify proxy check
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import traceback
|
||||
from couchpotato.core.helpers.variable import getImdb, md5, cleanHost
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.providers.base import YarrProvider
|
||||
@@ -32,7 +33,7 @@ class TorrentProvider(YarrProvider):
|
||||
try:
|
||||
data = self.urlopen(proxy, timeout = 3, show_error = False)
|
||||
except:
|
||||
log.debug('Failed %s proxy %s', (self.getName(), proxy))
|
||||
log.debug('Failed %s proxy %s: %s', (self.getName(), proxy, traceback.format_exc()))
|
||||
|
||||
if self.correctProxy(data):
|
||||
log.debug('Using proxy for %s: %s', (self.getName(), proxy))
|
||||
|
||||
@@ -17,10 +17,11 @@ class Yify(TorrentMagnetProvider):
|
||||
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',
|
||||
'http://yts.re',
|
||||
'https://yify-torrents.im',
|
||||
]
|
||||
|
||||
def search(self, movie, quality):
|
||||
@@ -61,4 +62,5 @@ class Yify(TorrentMagnetProvider):
|
||||
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
|
||||
data = data.lower()
|
||||
return 'yify' in data and 'yts' in data
|
||||
|
||||
Reference in New Issue
Block a user