summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-20 20:35:18 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-20 20:35:18 +0200
commit3964f4231fa5ff68b07a50d23d3b233a0735612d (patch)
tree38ca7d44679fbc7e720c2191e53c688246c71c6b /module/plugins
parentCode optimized (diff)
downloadpyload-3964f4231fa5ff68b07a50d23d3b233a0735612d.tar.xz
Simplydebrid: fixed syntax error
+ code reformatted + removed unused imports
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/SimplydebridCOM.py13
-rw-r--r--module/plugins/hooks/SimplydebridCOM.py3
-rw-r--r--module/plugins/hoster/SimplydebridCOM.py8
3 files changed, 11 insertions, 13 deletions
diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py
index faa6091c5..2b14a37c2 100644
--- a/module/plugins/accounts/SimplydebridCOM.py
+++ b/module/plugins/accounts/SimplydebridCOM.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
+from time import mktime, strptime
+
from module.plugins.Account import Account
-import re
-from time import mktime, strptime
class SimplydebridCOM(Account):
__name__ = "SimplydebridCOM"
@@ -14,20 +14,17 @@ class SimplydebridCOM(Account):
def loadAccountInfo(self, user, req):
get_data = {'login': 2, 'u': self.loginname, 'p': self.password}
- response = req.load("http://simply-debrid.com/api.php, get=get_data, decode=True)
+ response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True)
data = [x.strip() for x in response.split(";")]
if str(data[0]) != "1":
return {"premium": False}
else:
- return {
- "trafficleft": -1,
- "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y"))
- }
+ return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))}
def login(self, user, data, req):
self.loginname = user
self.password = data["password"]
get_data = {'login': 1, 'u': self.loginname, 'p': self.password}
- response = req.load("http://simply-debrid.com/api.php, get=get_data, decode=True)
+ response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True)
if response != "02: loggin success":
self.wrongPassword()
diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py
index 721dce6ca..b45d289ee 100644
--- a/module/plugins/hooks/SimplydebridCOM.py
+++ b/module/plugins/hooks/SimplydebridCOM.py
@@ -3,6 +3,7 @@
from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
+
class SimplydebridCOM(MultiHoster):
__name__ = "SimplydebridCOM"
__version__ = "0.01"
@@ -16,4 +17,4 @@ class SimplydebridCOM(MultiHoster):
def getHoster(self):
page = getURL("http://simply-debrid.com/api.php?list=1")
- return [x.strip() for x in page.rstrip(';').replace("\"","").split(";")]
+ return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")]
diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py
index 499c17145..69c5b8af1 100644
--- a/module/plugins/hoster/SimplydebridCOM.py
+++ b/module/plugins/hoster/SimplydebridCOM.py
@@ -1,12 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from module.plugins.Hoster import Hoster
-from module.utils import html_unescape
from urllib import quote, unquote
-from time import sleep
import re
+from module.plugins.Hoster import Hoster
+
+
class SimplydebridCOM(Hoster):
__name__ = "SimplydebridCOM"
__version__ = "0.1"
@@ -34,7 +34,7 @@ class SimplydebridCOM(Hoster):
if not re.match(self.__pattern__, new_url):
page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password'])
- if('tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page)):
+ if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page):
self.fail('Unable to unrestrict link')
new_url = page