diff options
author | prOq <anonim> | 2014-10-24 19:29:58 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-05 21:04:44 +0100 |
commit | f000135de9d6de7277080683c2b9d396da65e7f5 (patch) | |
tree | 93dff2558843e549e8ca2e0e372615da4f1c001d | |
parent | [RapiduNet] new hoster and account plugin (diff) | |
download | pyload-f000135de9d6de7277080683c2b9d396da65e7f5.tar.xz |
[FileSharkPl] Recovered needed behaviour
Conflicts:
module/plugins/hoster/FileSharkPl.py
-rw-r--r-- | module/plugins/hoster/FileSharkPl.py | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 5a9cbb456..5683d2a9e 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}' @@ -50,20 +50,32 @@ class FileSharkPl(SimpleHoster): def prepare(self): super(FileSharkPl, self).prepare() + # check if file is now available for download (-> file name can be found in html body) + try: + m = re.search(self.FILE_NAME_PATTERN, self.html) + pyfile.name = m.group('N') + except: + try: + m = re.match(self.__pattern__, pyfile.url) + pyfile.name = m.group(1) + except: + pyfile.name = "NoName" + + sec = re.search(self.SECONDS_PATTERN, self.html) + if sec: + self.retry(15,int(sec.group(1)),"Another download already run") + m = re.search(self.DOWNLOAD_ALERT, self.html): if m: - return - - alert = m.group(1) - - if re.match(self.IP_BLOCKED_PATTERN, alert): - self.fail(_("Only connections from Polish IP are allowed")) - elif re.match(self.DOWNLOAD_SLOTS_ERROR_PATTERN, alert): - self.logInfo(_("No free download slots available")) - self.retry(10, 30 * 60, _("Still no free download slots available")) - else: - self.logInfo(alert) - self.retry(10, 10 * 60, _("Try again later")) + alert = m.group(1) + if re.match(self.IP_BLOCKED_PATTERN, alert): + self.fail(_("Only connections from Polish IP are allowed")) + elif re.match(self.DOWNLOAD_SLOTS_ERROR_PATTERN, alert): + self.logInfo(_("No free download slots available")) + self.retry(10, 30 * 60, _("Still no free download slots available")) + else: + self.logInfo(alert) + self.retry(10, 10 * 60, _("Try again later")) #@NOTE: handlePremium method was never been tested |