diff options
| author | 2013-03-13 15:33:04 +0100 | |
|---|---|---|
| committer | 2013-03-13 15:33:04 +0100 | |
| commit | 55048e9b3ec2cebb32d36c4c6c9dd20031ed4ad1 (patch) | |
| tree | f655d37b074299f75b24e4d16ce62eb45a8c3ffb /module/plugins/hoster | |
| parent | EgoFilesCom: minor changes (diff) | |
| download | pyload-55048e9b3ec2cebb32d36c4c6c9dd20031ed4ad1.tar.xz | |
EgoFilesCom: premium better handled
Diffstat (limited to 'module/plugins/hoster')
| -rw-r--r-- | module/plugins/hoster/EgoFilesCom.py | 19 | 
1 files changed, 12 insertions, 7 deletions
| 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'<a href="(?P<link>[^"]+)">Download ></a>', 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)
 | 
