summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/EgoFilesCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/EgoFilesCom.py')
-rw-r--r--module/plugins/hoster/EgoFilesCom.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py
index 24e26c7f5..b27abb416 100644
--- a/module/plugins/hoster/EgoFilesCom.py
+++ b/module/plugins/hoster/EgoFilesCom.py
@@ -4,22 +4,18 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
from module.plugins.ReCaptcha import ReCaptcha
import re
-def to_seconds(m):
- minutes = int(m['m']) if m['m'] else 0
- seconds = int(m['s']) if m['s'] else 0
- return minutes * 60 + seconds
class EgoFilesCom(SimpleHoster):
__name__ = "EgoFilesCom"
__type__ = "hoster"
__pattern__ = r"https?://(www\.)?egofiles.com/(\w+)"
- __version__ = "0.07"
+ __version__ = "0.10"
__description__ = """Egofiles.com Download Hoster"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
FILE_INFO_PATTERN = r'<div class="down-file">\s+(?P<N>\S+)\s+<div class="file-properties">\s+(File size|Rozmiar): (?P<S>[\w.]+) (?P<U>\w+) \|'
- FILE_OFFLINE_PATTERN = r'File size: 0 KB'
+ FILE_OFFLINE_PATTERN = r'(File size|Rozmiar): 0 KB'
WAIT_TIME_PATTERN = r'For next free download you have to wait <strong>((?P<m>\d*)m)? ?((?P<s>\d+)s)?</strong>'
DIRECT_LINK_PATTERN = r'<a href="(?P<link>[^"]+)">Download ></a>'
RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX'
@@ -29,19 +25,14 @@ class EgoFilesCom(SimpleHoster):
# Set English language
self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True)
- def process(self, pyfile):
- if self.premium:
- self.handlePremium()
- else:
- self.handleFree()
-
def handleFree(self):
self.html = self.load(self.pyfile.url, decode=True)
# Wait time between free downloads
if 'For next free download you have to wait' in self.html:
- m = re.search(self.WAIT_TIME_PATTERN, self.html)
- self.setWait(to_seconds(m.groupdict()), True)
+ m = re.search(self.WAIT_TIME_PATTERN, self.html).groupdict('0')
+ waittime = int(m['m']) * 60 + int(m['s'])
+ self.setWait(waittime, True)
self.wait()
downloadURL = ''