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