summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-10-26 20:55:08 +0200
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-10-26 20:55:08 +0200
commit71d8e18b672a1353ecb276c6fe1a78ba789d7420 (patch)
treecf820d6d64b8b0053a7e55dd8482dcf72fa2cb9a /module/plugins
parentalso use "rar" to extract (diff)
downloadpyload-71d8e18b672a1353ecb276c6fe1a78ba789d7420.tar.xz
sharerapid.com fix server response 401
Diffstat (limited to 'module/plugins')
-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)