From f6ed82016a35e5dc1fc278865502de1955b5c37d Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 8 Mar 2013 20:30:21 +0100 Subject: New hoster: EgoFilesCom http://forum.pyload.org/viewtopic.php?f=13&t=1959 --- module/plugins/hoster/EgoFilesCom.py | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 module/plugins/hoster/EgoFilesCom.py (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py new file mode 100644 index 000000000..376b1fd5b --- /dev/null +++ b/module/plugins/hoster/EgoFilesCom.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, parseFileInfo +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.01" + __description__ = """Egofiles.com Download Hoster""" + __author_name__ = ("stickell") + __author_mail__ = ("l.stickell@yahoo.it") + + FILE_INFO_PATTERN = r'
\s+(?P\S+)\s+
\s+File size: (?P[\w.]+) (?P\w+) \|' + WAIT_TIME_PATTERN = r'For next free download you have to wait ((?P\d*)m)? ?((?P\d+)s)?' + RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' + + def init(self): + self.file_info = {} + # Set English language + self.load("https://egofiles.com/ajax/lang.php?lang=en", just_header=True) + + 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) + self.wait() + + downloadURL = '' + recaptcha = ReCaptcha(self) + for i in xrange(5): + challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + 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) + if not m: + self.logError('Wrong captcha') + self.invalidCaptcha() + elif hasattr(m, 'group'): + downloadURL = m.group('link') + self.correctCaptcha() + break + else: + self.fail('Unknown error - Plugin may be out of date') + + if not downloadURL: + self.fail("No Download url retrieved/all captcha attempts failed") + + self.download(downloadURL) + +getInfo = create_getInfo(EgoFilesCom) -- cgit v1.2.3 From 2b1a2f6a7b904ec3affeb08076f7e7bf0f68e8c1 Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 8 Mar 2013 21:11:53 +0100 Subject: EgoFilesCom: added ability to detect offline files --- module/plugins/hoster/EgoFilesCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 376b1fd5b..61203f9bd 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, parseFileInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.ReCaptcha import ReCaptcha import re @@ -13,12 +13,13 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") FILE_INFO_PATTERN = r'
\s+(?P\S+)\s+
\s+File size: (?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)?' RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' -- cgit v1.2.3 From db38a45f836b444f0bf19eddb493f1d1dae10618 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 11 Mar 2013 19:48:25 +0100 Subject: EgoFilesCom: added support for premium downloads http://forum.pyload.org/viewtopic.php?f=13&t=1959 --- module/plugins/hoster/EgoFilesCom.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 61203f9bd..2109c8ea7 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.02" + __version__ = "0.03" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -28,6 +28,12 @@ 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) @@ -60,4 +66,7 @@ class EgoFilesCom(SimpleHoster): self.download(downloadURL) + def handlePremium(self): + self.download(self.pyfile.url) + getInfo = create_getInfo(EgoFilesCom) -- cgit v1.2.3 From c2c9dd9941748bfc1508c60892ffd71f7980b552 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 11 Mar 2013 22:03:56 +0100 Subject: EgoFilesCom: regex updated --- module/plugins/hoster/EgoFilesCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 2109c8ea7..ad904063c 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -13,12 +13,12 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") - FILE_INFO_PATTERN = r'
\s+(?P\S+)\s+
\s+File size: (?P[\w.]+) (?P\w+) \|' + 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)?' RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' -- cgit v1.2.3 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/plugins/hoster/EgoFilesCom.py') 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/plugins/hoster/EgoFilesCom.py') 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/plugins/hoster/EgoFilesCom.py') 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 From 480b688d4490c9087a30af92a8c3400bce9341b3 Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 20 Mar 2013 20:31:45 +0100 Subject: EgoFilesCom: better file offline pattern. http://forum.pyload.org/viewtopic.php?p=8359#p8359 --- module/plugins/hoster/EgoFilesCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 24e26c7f5..6b8fbd8f0 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -13,13 +13,13 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.07" + __version__ = "0.08" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") FILE_INFO_PATTERN = r'
\s+(?P\S+)\s+
\s+(File size|Rozmiar): (?P[\w.]+) (?P\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 ((?P\d*)m)? ?((?P\d+)s)?' DIRECT_LINK_PATTERN = r'Download >' RECAPTCHA_KEY = '6LeXatQSAAAAAHezcjXyWAni-4t302TeYe7_gfvX' -- cgit v1.2.3 From 5852d7eddfef1713a857cf8f205545c7e1be7fb7 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 23 Mar 2013 14:12:23 +0100 Subject: Code cleanup --- module/plugins/hoster/EgoFilesCom.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 6b8fbd8f0..211f990ab 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -4,16 +4,12 @@ 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.08" + __version__ = "0.09" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -40,8 +36,9 @@ class EgoFilesCom(SimpleHoster): # 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 = '' -- cgit v1.2.3 From d55a25fe53a5e6d58845735c389951fa57d45674 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 23 Mar 2013 16:33:41 +0100 Subject: EgoFilesCom: File Info are now retrieved --- module/plugins/hoster/EgoFilesCom.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'module/plugins/hoster/EgoFilesCom.py') diff --git a/module/plugins/hoster/EgoFilesCom.py b/module/plugins/hoster/EgoFilesCom.py index 211f990ab..b27abb416 100644 --- a/module/plugins/hoster/EgoFilesCom.py +++ b/module/plugins/hoster/EgoFilesCom.py @@ -9,7 +9,7 @@ class EgoFilesCom(SimpleHoster): __name__ = "EgoFilesCom" __type__ = "hoster" __pattern__ = r"https?://(www\.)?egofiles.com/(\w+)" - __version__ = "0.09" + __version__ = "0.10" __description__ = """Egofiles.com Download Hoster""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") @@ -25,12 +25,6 @@ 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) -- cgit v1.2.3