summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/ShareRapidCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/ShareRapidCom.py')
-rw-r--r--module/plugins/hoster/ShareRapidCom.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py
index ce1912d38..46818a84c 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):
@@ -41,8 +42,8 @@ def getInfo(urls):
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"
+ __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)/(stahuj/.+)"
+ __version__ = "0.42"
__description__ = """Share-rapid.com plugin - premium only"""
__author_name__ = ("MikyWoW", "zoidberg")
__author_mail__ = ("MikyWoW@seznam.cz", "zoidberg@mujmail.cz")
@@ -61,14 +62,20 @@ class ShareRapidCom(Hoster):
def process(self, pyfile):
if not self.account: self.fail("User not logged in")
+ url = "http://share-rapid.com/" + re.search(self.__pattern__, pyfile.url).groups()[-1]
+ self.logDebug("URL: " + url)
- self.html = self.load(pyfile.url, decode=True)
+ try:
+ self.html = self.load(url, decode=True)
+ except BadHeader, e:
+ self.account.relogin(self.user)
+ self.retry(3, 0, str(e))
+
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)