summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/DatoidCz.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/DatoidCz.py')
-rw-r--r--module/plugins/accounts/DatoidCz.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/module/plugins/accounts/DatoidCz.py b/module/plugins/accounts/DatoidCz.py
new file mode 100644
index 000000000..22cce9d30
--- /dev/null
+++ b/module/plugins/accounts/DatoidCz.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.internal.Account import Account
+
+
+class DatoidCz(Account):
+ __name__ = "DatoidCz"
+ __type__ = "account"
+ __version__ = "0.38"
+ __status__ = "testing"
+
+ __description__ = """Datoid.cz account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("GammaC0de", None)]
+
+
+ def grab_info(self, user, password, data):
+ html = self.load("https://datoid.cz/")
+
+ m = re.search(r'"menu-bar-storage"></i> ([\d.,]+) ([\w^_]+)', html)
+ trafficleft = self.parse_traffic(m.group(1), m.group(2)) if m else 0
+
+
+ info = {'validuntil' : -1,
+ 'trafficleft': trafficleft,
+ 'premium' : True}
+
+ return info
+
+
+ def signin(self, user, password, data):
+ html = self.load("https://datoid.cz/")
+ if 'href="/muj-ucet">' in html:
+ self.skip_login()
+
+ html = self.load("https://datoid.cz/prihlaseni?do=signInForm-submit",
+ post={'username': user,
+ 'password': password})
+
+ if 'href="/muj-ucet">' not in html:
+ self.fail_login()