summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Nitzo <nitzo2001@yahoo.com> 2016-03-23 00:16:30 +0100
committerGravatar Nitzo <nitzo2001@yahoo.com> 2016-03-23 00:16:30 +0100
commit8db8aee2779cdc15696b7dc3cefe1625021fe5e7 (patch)
tree5646679d27609ab0dc1e5318ee22ac47a720b37e /module
parent [misc] revert https://github.com/pyload/pyload/commit/e5b69006811275b28a282c... (diff)
downloadpyload-8db8aee2779cdc15696b7dc3cefe1625021fe5e7.tar.xz
[RapidgatorNet] Update
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/RapidgatorNet.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py
index 50bbb0414..f8584c0b9 100644
--- a/module/plugins/hoster/RapidgatorNet.py
+++ b/module/plugins/hoster/RapidgatorNet.py
@@ -9,13 +9,13 @@ from module.plugins.captcha.AdsCaptcha import AdsCaptcha
from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.captcha.SolveMedia import SolveMedia
from module.plugins.internal.SimpleHoster import SimpleHoster
-from module.plugins.internal.misc import json
+from module.plugins.internal.misc import json, seconds_to_midnight
class RapidgatorNet(SimpleHoster):
__name__ = "RapidgatorNet"
__type__ = "hoster"
- __version__ = "0.40"
+ __version__ = "0.41"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+'
@@ -43,9 +43,9 @@ class RapidgatorNet(SimpleHoster):
JSVARS_PATTERN = r'\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*\'?(.*?)\'?;'
- PREMIUM_ONLY_PATTERN = r'You can download files up to|This file can be downloaded by premium only<'
- ERROR_PATTERN = r'You have reached your (?:daily|hourly) downloads limit'
- WAIT_PATTERN = r'(Delay between downloads must be not less than|Try again in).+'
+ PREMIUM_ONLY_PATTERN = r'You can download files up to|This file can be downloaded by premium only<'
+ DOWNLOAD_LIMIT_ERROR_PATTERN = r'You have reached your (daily|hourly) downloads limit'
+ WAIT_PATTERN = r'(?:Delay between downloads must be not less than|Try again in).+'
LINK_FREE_PATTERN = r'return \'(http://\w+.rapidgator.net/.*)\';'
@@ -104,6 +104,19 @@ class RapidgatorNet(SimpleHoster):
self.link = self.api_response('download')['url']
+ def check_errors(self):
+ super(RapidgatorNet, self).check_errors()
+ m = re.search(self.DOWNLOAD_LIMIT_ERROR_PATTERN, self.data)
+ if m:
+ self.log_warning(m.group(0))
+ if m.group(1) == "daily":
+ wait_time = seconds_to_midnight()
+ else:
+ wait_time = 1 * 60 * 60
+
+ self.retry(wait=wait_time, msg=m.group(0))
+
+
def handle_free(self, pyfile):
jsvars = dict(re.findall(self.JSVARS_PATTERN, self.data))
self.log_debug(jsvars)