Fix Yify proxy check
This commit is contained in:
1 parent
afac06081c
commit
9e991e1595
2 files changed
+6
-3
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
|
import traceback
|
||||||
from couchpotato.core.helpers.variable import getImdb, md5, cleanHost
|
from couchpotato.core.helpers.variable import getImdb, md5, cleanHost
|
||||||
from couchpotato.core.logger import CPLog
|
from couchpotato.core.logger import CPLog
|
||||||
from couchpotato.core.providers.base import YarrProvider
|
from couchpotato.core.providers.base import YarrProvider
|
||||||
@@ -32,7 +33,7 @@ class TorrentProvider(YarrProvider):
|
|||||||
try:
|
try:
|
||||||
data = self.urlopen(proxy, timeout = 3, show_error = False)
|
data = self.urlopen(proxy, timeout = 3, show_error = False)
|
||||||
except:
|
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):
|
if self.correctProxy(data):
|
||||||
log.debug('Using proxy for %s: %s', (self.getName(), proxy))
|
log.debug('Using proxy for %s: %s', (self.getName(), proxy))
|
||||||
|
|||||||
@@ -17,10 +17,11 @@ class Yify(TorrentMagnetProvider):
|
|||||||
http_time_between_calls = 1 #seconds
|
http_time_between_calls = 1 #seconds
|
||||||
|
|
||||||
proxy_list = [
|
proxy_list = [
|
||||||
'https://yify-torrents.im',
|
|
||||||
'http://yify.unlocktorrent.com',
|
'http://yify.unlocktorrent.com',
|
||||||
'http://yify.ftwnet.co.uk',
|
'http://yify.ftwnet.co.uk',
|
||||||
'http://yify-torrents.com.come.in',
|
'http://yify-torrents.com.come.in',
|
||||||
|
'http://yts.re',
|
||||||
|
'https://yify-torrents.im',
|
||||||
]
|
]
|
||||||
|
|
||||||
def search(self, movie, quality):
|
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()))
|
log.error('Failed getting results from %s: %s', (self.getName(), traceback.format_exc()))
|
||||||
|
|
||||||
def correctProxy(self, data):
|
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