summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-16 02:22:43 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-16 02:22:43 +0100
commit1390354da0deba9b9f5746453faa88079f37ddab (patch)
tree5fc6cfec8ff19ae72b8237bf1d04e9155cae0912
parentUpdate plugins (diff)
parentMake the waiting time work again on OneFichier.com (diff)
downloadpyload-1390354da0deba9b9f5746453faa88079f37ddab.tar.xz
Merge branch 'pr/n959_philou75' into stable
Conflicts: module/plugins/internal/SimpleHoster.py
-rw-r--r--module/plugins/hoster/OneFichierCom.py19
-rw-r--r--module/plugins/internal/SimpleHoster.py6
2 files changed, 7 insertions, 18 deletions
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py
index 346317271..f0e16a101 100644
--- a/module/plugins/hoster/OneFichierCom.py
+++ b/module/plugins/hoster/OneFichierCom.py
@@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class OneFichierCom(SimpleHoster):
__name__ = "OneFichierCom"
__type__ = "hoster"
- __version__ = "0.74"
+ __version__ = "0.75"
__pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P<ID2>\w+))?'
@@ -30,7 +30,7 @@ class OneFichierCom(SimpleHoster):
COOKIES = [("1fichier.com", "LG", "en")]
- WAIT_PATTERN = r'>You must wait (\d+)'
+ WAIT_PATTERN = r'>You must wait (\d+) minutes'
def setup(self):
@@ -38,14 +38,7 @@ class OneFichierCom(SimpleHoster):
self.resumeDownload = True
- def handle(self, reconnect):
- m = re.search(self.WAIT_PATTERN, self.html)
- if m:
- wait_time = int(m.group(1)) * 60
-
- self.wait(wait_time, reconnect)
- self.retry(reason="You have to wait been each free download")
-
+ def handleFree(self):
id = self.info['pattern']['ID1'] or self.info['pattern']['ID2']
url, inputs = self.parseHtmlForm('action="https://1fichier.com/\?%s' % id)
@@ -60,12 +53,8 @@ class OneFichierCom(SimpleHoster):
self.download(url, post=inputs)
- def handleFree(self):
- return self.handle(True)
-
-
def handlePremium(self):
- return self.handle(False)
+ return self.handleFree()
getInfo = create_getInfo(OneFichierCom)
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index ddaea020a..992454451 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -144,7 +144,7 @@ def _isDirectLink(self, url, resumable=True):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
__type__ = "hoster"
- __version__ = "0.72"
+ __version__ = "0.73"
__pattern__ = r'^unmatchable$'
@@ -416,8 +416,8 @@ class SimpleHoster(Hoster):
m = re.search(self.WAIT_PATTERN, self.html)
if m:
wait_time = sum([int(v) * {"hr": 3600, "hour": 3600, "min": 60, "sec": 1}[u.lower()] for v, u in
- re.findall(r'(\d+)\s*(hr|hour|min|sec)', m, re.I)])
- self.wait(wait_time, False)
+ re.findall(r'(\d+)\s*(hr|hour|min|sec)', m.group(0), re.I)])
+ self.wait(wait_time, True if wait_time > 300 else False)
return
self.info.pop('error', None)