FTDWorld use simple login

Add size
This commit is contained in:
Ruud committed 2013-01-09 20:42:33 +01:00
1 parent 8892ace3c2
commit 3c728608e9
1 file changed
+7 -2
@@ -4,6 +4,7 @@ from couchpotato.core.logger import CPLog
from couchpotato.core.providers.nzb.base import NZBProvider from couchpotato.core.providers.nzb.base import NZBProvider
from couchpotato.environment import Env from couchpotato.environment import Env
from dateutil.parser import parse from dateutil.parser import parse
import json
import traceback import traceback
log = CPLog(__name__) log = CPLog(__name__)
@@ -15,7 +16,7 @@ class FTDWorld(NZBProvider):
'search': 'http://ftdworld.net/api/index.php?%s', 'search': 'http://ftdworld.net/api/index.php?%s',
'detail': 'http://ftdworld.net/spotinfo.php?id=%s', 'detail': 'http://ftdworld.net/spotinfo.php?id=%s',
'download': 'http://ftdworld.net/cgi-bin/nzbdown.pl?fileID=%s', 'download': 'http://ftdworld.net/cgi-bin/nzbdown.pl?fileID=%s',
'login': 'http://ftdworld.net/index.php', 'login': 'http://ftdworld.net/api/login.php',
} }
http_time_between_calls = 3 #seconds http_time_between_calls = 3 #seconds
@@ -56,6 +57,7 @@ class FTDWorld(NZBProvider):
'id': nzb_id, 'id': nzb_id,
'name': toUnicode(item.get('Title')), 'name': toUnicode(item.get('Title')),
'age': self.calculateAge(tryInt(item.get('Created'))), 'age': self.calculateAge(tryInt(item.get('Created'))),
'size': item.get('Size', 0),
'url': self.urls['download'] % nzb_id, 'url': self.urls['download'] % nzb_id,
'download': self.loginDownload, 'download': self.loginDownload,
'detail_url': self.urls['detail'] % nzb_id, 'detail_url': self.urls['detail'] % nzb_id,
@@ -73,4 +75,7 @@ class FTDWorld(NZBProvider):
}) })
def loginSuccess(self, output): def loginSuccess(self, output):
return 'password is incorrect' not in output try:
return json.loads(output).get('goodToGo', False)
except:
return False