summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-01 01:37:31 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-01 01:37:31 +0100
commit58da2705f59d4e593058f130f61fb6ca28dd15a2 (patch)
treee538380ec7a2628d273451183ad8bfbb29442194
parent[BasePlugin] Improve downloadFile routine (diff)
parent[SafesharingEu] Added support for registered users. (diff)
downloadpyload-58da2705f59d4e593058f130f61fb6ca28dd15a2.tar.xz
Merge pull request #821 from Guidobelix/SafesharingEu
[SafesharingEu] New hoster & account plugins
-rw-r--r--module/plugins/accounts/SafesharingEu.py19
-rw-r--r--module/plugins/hoster/SafesharingEu.py36
2 files changed, 55 insertions, 0 deletions
diff --git a/module/plugins/accounts/SafesharingEu.py b/module/plugins/accounts/SafesharingEu.py
new file mode 100644
index 000000000..a2b964cba
--- /dev/null
+++ b/module/plugins/accounts/SafesharingEu.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.XFSAccount import XFSAccount
+
+
+class SafesharingEu(XFSAccount):
+ __name__ = "SafesharingEu"
+ __type__ = "account"
+ __version__ = "0.02"
+
+ __description__ = """Safesharing.eu account plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("guidobelix", "guidobelix@hotmail.it")]
+
+
+ HOSTER_DOMAIN = "safesharing.eu"
+
+ VALID_UNTIL_PATTERN = r'> Premium.[Aa]ccount expire:(.+?)</div>'
+ TRAFFIC_LEFT_PATTERN = r'> Traffic available today:\s*?(?P<S>[\d.,]+)\s*?(?:(?P<U>[\w^_]+)\s*)?</div>'
diff --git a/module/plugins/hoster/SafesharingEu.py b/module/plugins/hoster/SafesharingEu.py
new file mode 100644
index 000000000..92a0ff932
--- /dev/null
+++ b/module/plugins/hoster/SafesharingEu.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
+
+
+class SafesharingEu(XFSHoster):
+ __name__ = "SafesharingEu"
+ __type__ = "hoster"
+ __version__ = "0.04"
+
+ __pattern__ = r'https?://(?:\w+\.)?safesharing.eu/\w+'
+
+ __description__ = """Safesharing.eu hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")]
+
+ HOSTER_DOMAIN = "safesharing.eu"
+
+ FILE_NAME_PATTERN = r'Filename:</b></td><td nowrap>(?P<N>.*)</td></tr>'
+ FILE_SIZE_PATTERN = r'Size:</b></td><td>(?P<S>.*) (?P<U>[kKmMbB]*) <small>'
+
+ FILE_ID_PATTERN = r'<input type="hidden" name="id" value="(.*)">'
+ OFFLINE_PATTERN = r'<b>File Not Found</b>'
+ TEMP_OFFLINE_PATTERN = r'This server is in maintenance mode'
+
+
+ WAIT_PATTERN = r'You have to wait (\d+) minutes'
+ COUNTDOWN_PATTERN = r'<br><span id="countdown_str">Wait <span id=".*">(\d+)</span> seconds</span>'
+
+ RECAPTCHA_KEY_PATTERN = r'<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge\?k=(.*)"></script>'
+ RANDOM_STRING_PATTERN = r'<input type="hidden" name="rand" value="(.*)">'
+
+ ERROR_PATTERN = r'(?:<div class="alert alert-danger">)(.+?)(?:</div>)'
+
+
+getInfo = create_getInfo(SafesharingEu)