Browse Source

Don't throw out good data when there is no error

Based on playing with the HD4Free API, it looks like the 'error' property is only added if there is an error
So instead of ignoring all the data, just look for the property if/when we need it.
pull/6583/head
Brian Hartvigsen 9 years ago
parent
commit
17c601c626
  1. 9
      couchpotato/core/media/_base/providers/torrent/hd4free.py

9
couchpotato/core/media/_base/providers/torrent/hd4free.py

@ -25,11 +25,10 @@ class Base(TorrentProvider):
def _search(self, movie, quality, results):
data = self.getJsonData(self.urls['search'] % (self.conf('apikey'), self.conf('username'), getIdentifier(movie), self.conf('internal_only')))
if 'error' in data:
if data:
if self.login_fail_msg in data['error']: # Check for login failure
self.disableAccount()
return
if data:
if error in data and self.login_fail_msg in data['error']: # Check for login failure
self.disableAccount()
return
try:
#for result in data[]:

Loading…
Cancel
Save