diff options
Diffstat (limited to 'module')
| -rw-r--r-- | module/plugins/accounts/TurbobitNet.py | 56 | ||||
| -rw-r--r-- | module/plugins/crypter/LixIn.py | 6 | ||||
| -rw-r--r-- | module/plugins/hoster/TurbobitNet.py | 17 | 
3 files changed, 71 insertions, 8 deletions
| diff --git a/module/plugins/accounts/TurbobitNet.py b/module/plugins/accounts/TurbobitNet.py new file mode 100644 index 000000000..c4b819131 --- /dev/null +++ b/module/plugins/accounts/TurbobitNet.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +""" +    This program is free software; you can redistribute it and/or modify +    it under the terms of the GNU General Public License as published by +    the Free Software Foundation; either version 3 of the License, +    or (at your option) any later version. + +    This program is distributed in the hope that it will be useful, +    but WITHOUT ANY WARRANTY; without even the implied warranty of +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +    See the GNU General Public License for more details. + +    You should have received a copy of the GNU General Public License +    along with this program; if not, see <http://www.gnu.org/licenses/>. +     +    @author: zoidberg +""" + +from module.plugins.Account import Account +import re +from time import mktime, strptime + +class TurbobitNet(Account): +    __name__ = "TurbobitNet" +    __version__ = "0.01" +    __type__ = "account" +    __description__ = """TurbobitNet account plugin""" +    __author_name__ = ("zoidberg") +    __author_mail__ = ("zoidberg@mujmail.cz") +     +    #login_timeout = 60 + +    def loadAccountInfo(self, user, req):         +        html = req.load("http://turbobit.net") +            +        found = re.search(r'<u>Turbo Access</u> to ([0-9.]+)', html) +        if found: +            premium = True +            validuntil = mktime(strptime(found.group(1), "%d.%m.%Y")) +        else: +            premium = False +            validuntil = -1 + +        return {"premium": premium, "trafficleft": -1, "validuntil": validuntil} + +    def login(self, user, data, req): +        req.cj.setCookie("turbobit.net", "user_lang", "en") +         +        html = req.load("http://turbobit.net/user/login", post={ +            "user[login]": user, +            "user[pass]": data["password"], +            "user[submit]": "Login"}) +         +        if not '<div class="menu-item user-name">' in html: +            self.wrongPassword()
\ No newline at end of file diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py index b9fd28a34..379b10764 100644 --- a/module/plugins/crypter/LixIn.py +++ b/module/plugins/crypter/LixIn.py @@ -9,13 +9,13 @@ class LixIn(Crypter):      __name__ = "LixIn"      __type__ = "container"      __pattern__ = r"http://(www.)?lix.in/(?P<id>.*)" -    __version__ = "0.2" +    __version__ = "0.21"      __description__ = """Lix.in Container Plugin"""      __author_name__ = ("spoob")      __author_mail__ = ("spoob@pyload.org")      CAPTCHA_PATTERN='<img src="(?P<image>captcha_img.php\?PHPSESSID=.*?)"' -    SUBMIT_PATTERN=r"value='continue .*?'" +    SUBMIT_PATTERN=r"value='continue.*?'"      LINK_PATTERN=r'name="ifram" src="(?P<link>.*?)"' @@ -46,7 +46,7 @@ class LixIn(Crypter):  	        else:  	            self.logDebug("no captcha/captcha solved")  	            break -	else: +    	else:              self.html = self.req.load(url, decode=True, post={"submit" : "submit",  	                                                      "tiny"   : id}) diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index ee55d257b..91cfd5145 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -27,13 +27,13 @@ class TurbobitNet(SimpleHoster):      __name__ = "TurbobitNet"      __type__ = "hoster"      __pattern__ = r"http://(?:\w*\.)?turbobit.net/(?P<ID>\w+).*" -    __version__ = "0.01" +    __version__ = "0.02"      __description__ = """Turbobit.net plugin"""      __author_name__ = ("zoidberg")      __author_mail__ = ("zoidberg@mujmail.cz") -    FILE_SIZE_PATTERN = r"<span class='file-icon1 document'>[^<]*</span>\s*\((?P<S>[^\)]+)\)" -    FILE_NAME_PATTERN = r'<meta name="keywords" content="(?P<N>[^,]+)' +    FILE_SIZE_PATTERN = r"</span>\s*\((?P<S>[^\)]+)\)\s*</h1>" +    FILE_NAME_PATTERN = r'<meta name="keywords" content="\s*(?P<N>[^,]+)'      FILE_OFFLINE_PATTERN = r'<h2>File Not Found</h2>'      FILE_URL_REPLACEMENTS = [(r'(?<=http://)(.*?)(?=turbobit.net/)', '')]      SH_COOKIES = [("turbobit.net", "user_lang", "en")] @@ -78,10 +78,17 @@ class TurbobitNet(SimpleHoster):          self.wait()          self.html = self.load("http://turbobit.net/download/getLinkAfterTimeout/" + self.file_info['ID']) +        self.downloadFile()        +     +    def handlePremium(self): +        self.logDebug("Premium download as user %s" % self.user) +        self.downloadFile() +         +    def downloadFile(self):          found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) -        if not found: self.parseError("free download link")         +        if not found: self.parseError("download link")                  self.url = "http://turbobit.net" + found.group('url')          self.logDebug(self.url) -        self.download(self.url) +        self.download(self.url)    getInfo = create_getInfo(TurbobitNet)
\ No newline at end of file | 
