summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/accounts/StahnuTo.py49
-rw-r--r--module/plugins/hoster/RapidgatorNet.py4
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py4
-rw-r--r--module/plugins/hoster/StahnuTo.py27
-rw-r--r--module/plugins/hoster/TurbobitNet.py4
5 files changed, 70 insertions, 18 deletions
diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py
new file mode 100644
index 000000000..8a4523bc5
--- /dev/null
+++ b/module/plugins/accounts/StahnuTo.py
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+
+"""
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ @author: zoidberg
+"""
+
+from module.plugins.Account import Account
+from module.utils import parseFileSize
+import re
+
+class StahnuTo(Account):
+ __name__ = "StahnuTo"
+ __version__ = "0.02"
+ __type__ = "account"
+ __description__ = """StahnuTo account plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ #login_timeout = 60
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.stahnu.to/")
+
+ found = re.search(r'>VIP: (\d+.*)<', html)
+ trafficleft = parseFileSize(found.group(1)) * 1024 if found else 0
+
+ return {"premium": trafficleft > (512 * 1024), "trafficleft": trafficleft, "validuntil": -1}
+
+ def login(self, user, data, req):
+ html = req.load("http://www.stahnu.to/login.php", post={
+ "username": user,
+ "password": data["password"],
+ "submit": "Login"})
+
+ if not '<a href="logout.php">' in html:
+ self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py
index e4424809c..8a6ab6150 100644
--- a/module/plugins/hoster/RapidgatorNet.py
+++ b/module/plugins/hoster/RapidgatorNet.py
@@ -27,7 +27,7 @@ class RapidgatorNet(SimpleHoster):
__name__ = "RapidgatorNet"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """rapidgator.net"""
__author_name__ = ("zoidberg")
@@ -39,7 +39,7 @@ class RapidgatorNet(SimpleHoster):
RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"'
def handleFree(self):
- if "You can download files up to 500 MB in free mode":
+ if "You can download files up to 500 MB in free mode" in self.html:
self.fail("File too large for free download")
self.checkWait()
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index cb624e7a2..8517d441d 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -43,7 +43,7 @@ class ShareonlineBiz(Hoster):
__name__ = "ShareonlineBiz"
__type__ = "hoster"
__pattern__ = r"http://[\w\.]*?(share\-online\.biz|egoshare\.com)/(download.php\?id\=|dl/)[\w]+"
- __version__ = "0.27"
+ __version__ = "0.28"
__description__ = """Shareonline.biz Download Hoster"""
__author_name__ = ("spoob", "mkaay", "zoidberg")
__author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
@@ -129,7 +129,7 @@ class ShareonlineBiz(Hoster):
self.download(download_url)
def handleAPIPremium(self): #should be working better
- self.account.getAccountInfo(self.user)
+ self.account.getAccountInfo(self.user, True)
src = self.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=download&lid=%s" % (self.user, self.account.accounts[self.user]["password"], self.file_id), post={})
self.api_data = dlinfo = {}
for line in src.splitlines():
diff --git a/module/plugins/hoster/StahnuTo.py b/module/plugins/hoster/StahnuTo.py
index a78615dba..354a99b1a 100644
--- a/module/plugins/hoster/StahnuTo.py
+++ b/module/plugins/hoster/StahnuTo.py
@@ -32,29 +32,32 @@ def getInfo(urls):
class StahnuTo(SimpleHoster):
__name__ = "StahnuTo"
__type__ = "hoster"
- __pattern__ = r"http://(\w*\.)?stahnu.to/(files/get/|.*\?file=)([^/]+).*"
- __version__ = "0.12"
+ __pattern__ = r"http://(?:\w*\.)?stahnu.to/(?:files/get/|.*\?file=)(?P<ID>[^/]+).*"
+ __version__ = "0.14"
__description__ = """stahnu.to"""
__author_name__ = ("zoidberg")
- FILE_NAME_PATTERN = r"<div class='nadpis-01'><h2>(?<N>[^<]+)</h2></div>"
- FILE_SIZE_PATTERN = r'<td>Velikost souboru<br /><span>(?<S>[^<]+)\s*(?<U>[kKMG])i?[Bb]</span></td>'
+ FILE_NAME_PATTERN = r"<td colspan='2'>N&aacute;zev souboru<br /><span>(?P<N>[^<]+)</span>"
+ FILE_SIZE_PATTERN = r'<td>Velikost souboru<br /><span>(?P<S>[^<]+)\s*(?P<U>[kKMG])i?[Bb]</span></td>'
FILE_OFFLINE_PATTERN = r'<!-- Obsah - start -->\s*<!-- Obsah - end -->'
- #FILE_OFFLINE_PATTERN = r'<h2 align="center">Tento soubor neexistuje nebo byl odstran&#283;n! </h2>'
- CAPTCHA_PATTERN = r'<img src="captcha/captcha.php" id="captcha" /></td>'
def setup(self):
self.multiDL = True
def process(self, pyfile):
+ if not self.account:
+ self.fail("Please enter your stahnu.to account")
+
found = re.search(self.__pattern__, pyfile.url)
- file_id = found.group(3)
+ file_id = found.group(1)
- self.html = self.load("http://stahnu.to/?file=" + file_id, decode=True)
+ self.html = self.load("http://www.stahnu.to/getfile.php?file=%s" % file_id, decode=True)
self.getFileInfo()
+
+ if "K sta&#382;en&iacute; souboru se mus&iacute;te <strong>zdarma</strong> p&#345;ihl&aacute;sit!" in self.html:
+ self.account.relogin(self.user)
+ self.retry()
- self.download("http://stahnu.to/files/gen/" + file_id, post={
- "file": file_id,
- "user": "Anonym",
- "commenttext": ""
+ self.download("http://www.stahnu.to/files/gen/" + file_id, post={
+ "downloadbutton": u"STÁHNOUT"
})
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py
index 95fcae7f2..f4626f49a 100644
--- a/module/plugins/hoster/TurbobitNet.py
+++ b/module/plugins/hoster/TurbobitNet.py
@@ -27,7 +27,7 @@ class TurbobitNet(SimpleHoster):
__name__ = "TurbobitNet"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?turbobit.net/(?:download/free/)?(?P<ID>\w+).*"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """Turbobit.net plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -40,7 +40,7 @@ class TurbobitNet(SimpleHoster):
CAPTCHA_KEY_PATTERN = r'src="http://api\.recaptcha\.net/challenge\?k=([^"]+)"'
DOWNLOAD_URL_PATTERN = r'(?P<url>/download/redirect/[^"\']+)'
- LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span> seconds'
+ LIMIT_WAIT_PATTERN = r'<div id="time-limit-text">\s*.*?<span id=\'timeout\'>(\d+)</span>'
CAPTCHA_SRC_PATTERN = r'<img alt="Captcha" src="(.*?)"'
def handleFree(self):