summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar GamaC0de <nitzo2001@yahoo.com> 2016-05-17 00:10:20 +0200
committerGravatar GamaC0de <nitzo2001@yahoo.com> 2016-05-17 00:10:20 +0200
commit7b68bbf7708ba49a4e9c51994d7631f10512c4d0 (patch)
tree8d109dda8535396259884fc8311e8d3e14abd801 /module
parent[New hoster] DatafileCom (fix 2461) (diff)
downloadpyload-7b68bbf7708ba49a4e9c51994d7631f10512c4d0.tar.xz
[DatafileCom] Update
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/DatafileCom.py27
1 files changed, 23 insertions, 4 deletions
diff --git a/module/plugins/hoster/DatafileCom.py b/module/plugins/hoster/DatafileCom.py
index fd4554ee9..8f270b3b8 100644
--- a/module/plugins/hoster/DatafileCom.py
+++ b/module/plugins/hoster/DatafileCom.py
@@ -2,7 +2,7 @@
import re
-from module.plugins.internal.misc import json
+from module.plugins.internal.misc import json, seconds_to_midnight
from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster
@@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster
class DatafileCom(SimpleHoster):
__name__ = "DatafileCom"
__type__ = "hoster"
- __version__ = "0.01"
+ __version__ = "0.02"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?datafile\.com/d/(?P<ID>\w{17})'
@@ -24,14 +24,15 @@ class DatafileCom(SimpleHoster):
__license__ = "GPLv3"
__authors__ = [("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")]
- NAME_PATTERN = r'<div class="file-name">\s+?(?P<N>\S+)\s+?<'
+ NAME_PATTERN = r'<div class="file-name">(?P<N>.+?)</div>'
SIZE_PATTERN = r'>Filesize: <span class="lime">(?P<S>[\d.,]+) (?P<U>[\w^_]+)'
- OFFLINE_PATTERN = r'Invalid Link'
+ OFFLINE_PATTERN = r'Invalid Link|Link Expired|This file was deleted'
TEMP_OFFLINE_PATTERN = r'You are downloading another file at this moment'
PREMIUM_ONLY_PATTERN = r'This file is only available for premium users'
DIRECT_LINK = False
+ DISPOSITION = False
def handle_free(self, pyfile):
@@ -69,3 +70,21 @@ class DatafileCom(SimpleHoster):
if file_info['success']:
self.link = file_info['link']
self.log_debug("URL:%s" % file_info['link'])
+
+ else:
+ m = re.search(r'error\.html\?code=(\d+)', self.req.lastEffectiveURL)
+ if m:
+ error_code = int(m.group(1))
+ if error_code in (2, 3):
+ self.offline()
+
+ elif error_code == 7:
+ wait_time = seconds_to_midnight()
+ self.retry(wait=wait_time, msg=_("Download limit exceeded"))
+
+ elif error_code == 9:
+ self.temp_offline()
+
+ else:
+ self.log_debug("Unknown error code %s" % error_code)
+