summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/ShareRapidCom.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py
index ce1912d38..1c83a889c 100644
--- a/module/plugins/hoster/ShareRapidCom.py
+++ b/module/plugins/hoster/ShareRapidCom.py
@@ -4,6 +4,7 @@
import re
from pycurl import HTTPHEADER
from module.network.RequestFactory import getRequest
+from module.network.HTTPRequest import BadHeader
from module.plugins.Hoster import Hoster
def getInfo(urls):
@@ -42,7 +43,7 @@ class ShareRapidCom(Hoster):
__name__ = "ShareRapidCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/.*"
- __version__ = "0.4"
+ __version__ = "0.41"
__description__ = """Share-rapid.com plugin - premium only"""
__author_name__ = ("MikyWoW", "zoidberg")
__author_mail__ = ("MikyWoW@seznam.cz", "zoidberg@mujmail.cz")
@@ -62,13 +63,17 @@ class ShareRapidCom(Hoster):
def process(self, pyfile):
if not self.account: self.fail("User not logged in")
- self.html = self.load(pyfile.url, decode=True)
+ try:
+ self.html = self.load(pyfile.url, decode=True)
+ except BadHeader:
+ self.account.relogin(self.user)
+ self.retry(3, 0, 'Bad server response, not logged in?')
+
size, units = re.search(self.FILE_SIZE_PATTERN, self.html).groups()
pyfile.size = float(size) * 1024 ** {'kB': 1, 'MB': 2, 'GB': 3}[units]
found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
if found is not None:
- self.logDebug(found)
link, pyfile.name = found.groups()
self.logInfo("Downloading file: %s (%s %s)" % (pyfile.name, size, units))
self.logInfo("Premium link: %s" % link)