diff options
| author | 2011-01-24 16:02:42 +0100 | |
|---|---|---|
| committer | 2011-01-24 16:02:42 +0100 | |
| commit | 2f79e4675cccb92e9f02ca8e2d2c5e2e9a67f26c (patch) | |
| tree | 90a3da0b069fb5eb21facf3aa02d94d0fb8eb5ee /module/plugins/hoster/FourSharedCom.py | |
| parent | closed memory leak in debug mode, closed #217 (diff) | |
| download | pyload-2f79e4675cccb92e9f02ca8e2d2c5e2e9a67f26c.tar.xz | |
4Shared plugin
Diffstat (limited to 'module/plugins/hoster/FourSharedCom.py')
| -rw-r--r-- | module/plugins/hoster/FourSharedCom.py | 48 | 
1 files changed, 48 insertions, 0 deletions
diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py new file mode 100644 index 000000000..df3d498bc --- /dev/null +++ b/module/plugins/hoster/FourSharedCom.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.Hoster import Hoster + +class FourSharedCom(Hoster): +    __name__ = "FourSharedCom" +    __type__ = "hoster" +    __pattern__ = r"http://[\w\.]*?4shared(-china)?\.com/(account/)?(download|get|file|document|photo|video|audio)/.+?/.*" +    __version__ = "0.1" +    __description__ = """4Shared Download Hoster""" +    __author_name__ = ("jeix") +    __author_mail__ = ("jeix@hasnomail.de") + +    def setup(self): +        self.multiDL = False + +    def process(self, pyfile): + +        html = self.load(pyfile.url) +        tmp_link = "" +        link = "" +        name = "" +        wait = 20 + +        for line in html.splitlines(): +            if "dbtn" in line: +                tmp_link = line.split('href="')[1].split('"')[0] +            if '<span id="fileNameTextSpan">' in line: +                name = line.split('<span id="fileNameTextSpan">')[1].split('</span>')[0].strip() + +        pyfile.name = name +       +        if tmp_link: +            html = self.load(tmp_link).splitlines() +            for i, line in enumerate(html): +                if "id='divDLStart'" in line: +                    link = html[i+1].split("<a href='")[1].split("'")[0] +                elif '<div class="sec">' in line: +                    wait = int(line.split(">")[1].split("<")[0]) + +        self.setWait(wait) +        self.wait() + +        if link: +            self.download(link) +        else: +            self.offline()
\ No newline at end of file  | 
