From d7a06aeddb8bc47d4a929ba587043853df3478a4 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 12 Mar 2013 20:20:28 +0100 Subject: EgoFilesCom: now handles premium correctly --- module/plugins/hoster/EgoFilesCom.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index ad904063c..32feecee2 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -13,7 +13,7 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.04" + __version__ = "0.05" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -67,6 +67,12 @@ class EgoFilesCom(SimpleHoster): self.download(downloadURL) def handlePremium(self): - self.download(self.pyfile.url) + self.html = self.load(self.pyfile.url, decode=True) + m = re.search(r'Download >', self.html) + if not m: + self.fail('Unable to detect direct download url - Plugin may be out of date') + else: + self.logDebug('DIRECT URL: ' + m.group('link')) + self.download(m.group('link')) getInfo = create_getInfo(EgoFilesCom) -- cgit v1.2.3 From e2f5f2d01848f2bb2ae5dd2460dc34401e3a4aeb Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 12 Mar 2013 21:27:54 +0100 Subject: EgoFilesCom: minor changes --- module/plugins/hoster/EgoFilesCom.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 32feecee2..340bd47de 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -13,7 +13,7 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.05" + __version__ = "0.06" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -21,6 +21,7 @@ class EgoFilesCom(SimpleHoster): FILE_INFO_PATTERN = r'
\s+(?P\S+)\s+
\s+(File size|Rozmiar): (?P[\w.]+) (?P\w+) \|' FILE_OFFLINE_PATTERN = r'File size: 0 KB' WAIT_TIME_PATTERN = r'For next free download you have to wait ((?P\d*)m)? ?((?P\d+)s)?' + DIRECT_LINK_PATTERN = r'Download >' RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' def init(self): @@ -50,9 +51,9 @@ class EgoFilesCom(SimpleHoster): post_data = {'recaptcha_challenge_field': challenge, 'recaptcha_response_field': response} self.html = self.load(self.pyfile.url, post=post_data, decode=True) - m = re.search(r'Download >', self.html) + m = re.search(self.DIRECT_LINK_PATTERN, self.html) if not m: - self.logError('Wrong captcha') + self.logInfo('Wrong captcha') self.invalidCaptcha() elif hasattr(m, 'group'): downloadURL = m.group('link') @@ -68,7 +69,7 @@ class EgoFilesCom(SimpleHoster): def handlePremium(self): self.html = self.load(self.pyfile.url, decode=True) - m = re.search(r'Download >', self.html) + m = re.search(self.DIRECT_LINK_PATTERN, self.html) if not m: self.fail('Unable to detect direct download url - Plugin may be out of date') else: -- cgit v1.2.3 From 55048e9b3ec2cebb32d36c4c6c9dd20031ed4ad1 Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 13 Mar 2013 15:33:04 +0100 Subject: EgoFilesCom: premium better handled --- module/plugins/hoster/EgoFilesCom.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 340bd47de..24e26c7f5 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -13,7 +13,7 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -68,12 +68,17 @@ class EgoFilesCom(SimpleHoster): self.download(downloadURL) def handlePremium(self): - self.html = self.load(self.pyfile.url, decode=True) - m = re.search(self.DIRECT_LINK_PATTERN, self.html) - if not m: - self.fail('Unable to detect direct download url - Plugin may be out of date') + header = self.load(self.pyfile.url, just_header=True) + if header.has_key('location'): + self.logDebug('DIRECT LINK from header: ' + header['location']) + self.download(header['location']) else: - self.logDebug('DIRECT URL: ' + m.group('link')) - self.download(m.group('link')) + self.html = self.load(self.pyfile.url, decode=True) + m = re.search(r'Download >', self.html) + if not m: + self.parseError('Unable to detect direct download url') + else: + self.logDebug('DIRECT URL from html: ' + m.group('link')) + self.download(m.group('link')) getInfo = create_getInfo(EgoFilesCom) -- cgit v1.2.3