diff options
Diffstat (limited to 'module/plugins/hoster')
| -rw-r--r-- | module/plugins/hoster/ArchivTo.py | 46 | ||||
| -rw-r--r-- | module/plugins/hoster/BitshareCom.py | 116 | ||||
| -rw-r--r-- | module/plugins/hoster/FilesonicCom.py | 4 | ||||
| -rw-r--r-- | module/plugins/hoster/MegauploadCom.py | 17 | ||||
| -rw-r--r-- | module/plugins/hoster/RapidshareCom.py | 4 | 
5 files changed, 177 insertions, 10 deletions
| diff --git a/module/plugins/hoster/ArchivTo.py b/module/plugins/hoster/ArchivTo.py new file mode 100644 index 000000000..02ff207ab --- /dev/null +++ b/module/plugins/hoster/ArchivTo.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster +from module.unescape import unescape + +class ArchivTo(Hoster): +    __name__ = "ArchivTo" +    __type__ = "hoster" +    __pattern__ = r"http://(www\.)?archiv.to/view/divx/" +    __version__ = "0.1" +    __description__ = """Archiv.to Video Download Hoster""" +    __author_name__ = ("Petersilie") +    __author_mail__ = ("None") + +    def setup(self): +        self.html = None + +    def process(self, pyfile): +        self.pyfile = pyfile +        self.download_html() +        pyfile.name = self.get_file_name() +        self.download(self.get_file_url()) + +    def download_html(self): +        # open url (save cookies needed for download) +        self.html = self.load(self.pyfile.url, cookies=True) + +    def get_file_url(self): +        # get actual file url for downloading +        file_url = re.search(r"autoplay=\"true\" custommode=\"none\" src=\"(http://.*?)\"", self.html).group(1) +        return file_url + +    def get_file_name(self): +        file_name = re.search(r"style=\"color:black;text-decoration:none;font-size:14px;font-weight:bold\">(.*?)</a>", self.html) +        if not file_name: +            file_name = re.search(r"movietitle=\"(.*?)\"", self.html) +        return unescape(file_name.group(1)) + +    def file_exists(self): +        # check if file still exists +        self.download_html() +        self.load(str(self.pyfile.url), cookies=False) +        if self.get_file_name(): +            return True +        return False diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py new file mode 100644 index 000000000..d092ad2dc --- /dev/null +++ b/module/plugins/hoster/BitshareCom.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from __future__ import with_statement + +import re + +from os import remove + +from module.plugins.Hoster import Hoster +from module.plugins.ReCaptcha import ReCaptcha + +from module.network.RequestFactory import getURL + +def getInfo(urls): +    result = [] +     +    for url in urls: +         +        # Get html +        html = getURL(url) +        if re.search(r'<h1>Error - File not available</h1>', html): +            result.append((url, 0, 1, url)) +         +        attribs = re.search('<h1>Downloading (.+?) - (\d+) (..)yte</h1>', html) +        # Name +        name = attribs.group(1) +         +        # Size +        units = float(attribs.group(2)) +        pow = {'KB' : 1, 'MB' : 2, 'GB' : 3}[attribs.group(3)]  +        size = int(units*1024**pow) +     +        # Return info +        result.append((name, size, 2, url)) +         +    yield result + +class BitshareCom(Hoster): +    __name__ = "BitshareCom" +    __type__ = "hoster" +    __pattern__ = r"http://(www\.)?bitshare\.com/(files/[a-zA-Z0-9]+|\?f=[a-zA-Z0-9]+)" +    __version__ = "0.1" +    __description__ = """Bitshare.Com File Download Hoster""" +    __author_name__ = ("paul", "king") +         +    def setup(self): +        self.multiDL = False + +    def process(self, pyfile): +     +        self.pyfile = pyfile +     +        if re.search(r"bitshare\.com/\?f=",self.pyfile.url): +            self.file_id = re.search(r"bitshare\.com/\?f=([a-zA-Z0-9]+)?", self.pyfile.url).group(1) +        else: +            self.file_id = re.search(r"bitshare\.com/files/([a-zA-Z0-9]+)?", self.pyfile.url).group(1) + +        self.log.debug("%s: file_id is %s" % (self.__name__,self.file_id)) +        self.pyfile.url = r"http://bitshare.com/?f=" + self.file_id + +        self.html = self.load(self.pyfile.url, ref=False, utf8=True) + +        if re.search(r'<h1>Error - File not available</h1>', self.html) is not None: +            self.offline() +            +        self.pyfile.name = re.search(r'<h1>Downloading (.+?) - (\d+) (..)yte</h1>', self.html).group(1) + +        self.ajaxid = re.search("var ajaxdl = \"(.*?)\";",self.html).group(1) +         +        self.log.debug("%s: AjaxId %s" % (self.__name__,self.ajaxid)) + +        self.handleFree() +     +    def handleFree(self): + +        action = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", +                            post={"request" : "generateID", "ajaxid" : self.ajaxid}) +        self.log.debug("%s: result of generateID %s" % (self.__name__,action)) +        parts = action.split(":") +     +        if parts[0] == "ERROR": +            self.fail(parts[1]) +         +        filetype = parts[0] +        wait = int(parts[1]) +        captcha = int(parts[2]) + +        if wait > 0: +            self.log.info("%s: Waiting %d seconds." % (self.__name__, wait)) +            self.setWait(wait, True) +            self.wait() +             +        if captcha == 1: +            id = re.search(r"http://api\.recaptcha\.net/challenge\?k=(.*?) ", self.html).group(1) +            self.log.debug("%s: ReCaptcha key %s" % (self.__name__, id)) +            for i in range(3):   # Try upto 3 times +                recaptcha = ReCaptcha(self) +                challenge, code = recaptcha.challenge(id) +                action = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", +                                post={"request" : "validateCaptcha", "ajaxid" : self.ajaxid, "recaptcha_challenge_field" : challenge, "recaptcha_response_field" : code}) +                parts = action.split(":") +                if parts[0] != "SUCCESS": +                    self.invalidCaptcha() +                else: +                    break + +        action = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", +                    post={"request" : "getDownloadURL", "ajaxid" : self.ajaxid}) + +        parts = action.split("#") +     +        if parts[0] == "ERROR": +            self.fail(parts[1]) + +        # this may either download our file or forward us to an error page +        self.log.debug("%s: download url %s" % (self.__name__, parts[1])) +        dl = self.download(parts[1]) diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py index 97060d36e..ce441f482 100644 --- a/module/plugins/hoster/FilesonicCom.py +++ b/module/plugins/hoster/FilesonicCom.py @@ -25,7 +25,7 @@ class FilesonicCom(Hoster):      __name__ = "FilesonicCom"
      __type__ = "hoster"
      __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\.(com|net)/.*?file/([0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?)"
 -    __version__ = "0.2"
 +    __version__ = "0.21"
      __description__ = """FilesonicCom und Sharingmatrix Download Hoster"""
      __author_name__ = ("jeix")
      __author_mail__ = ("jeix@hasnomail.de")
 @@ -133,3 +133,5 @@ class FilesonicCom(Hoster):          if "An Error Occurred" in self.html:
              self.fail("A server error occured.")
 +        if "This file was deleted" in self.html:
 +            self.offline()
 diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 9158e929e..9e5081fd3 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -30,17 +30,20 @@ def getInfo(urls):      for data in api:          if data[0].startswith("id"):              tmp = [x.split("=") for x in data] -            if tmp[2][1] == "3": -                status = 3 -            elif tmp[0][1] == "0": +            if tmp[0][1] == "0":                  status = 2              elif tmp[0][1] == "1":                  status = 1 +            elif tmp[2][1] == "3": +                status = 3              else:                  status = 3 -             -            name = unescape(tmp[3][1]) -            size = tmp[1][1] + +            name = None +            size = 0 +            if status != 1: +                name = unescape(tmp[3][1]) +                size = tmp[1][1]              result.append( (name, size, status, urls[i] ) )              i += 1 @@ -51,7 +54,7 @@ class MegauploadCom(Hoster):      __name__ = "MegauploadCom"      __type__ = "hoster"      __pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=[0-9A-Za-z]+" -    __version__ = "0.2" +    __version__ = "0.21"      __description__ = """Megaupload.com Download Hoster"""      __author_name__ = ("spoob")      __author_mail__ = ("spoob@pyload.org") diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index d98017d7b..2bc395a86 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -46,8 +46,8 @@ def getInfo(urls):  class RapidshareCom(Hoster):      __name__ = "RapidshareCom"      __type__ = "hoster" -    __pattern__ = r"http://[\w\.]*?rapidshare.com/(?:files/(?P<id>\d*?)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))" -    __version__ = "1.33" +    __pattern__ = r"https?://[\w\.]*?rapidshare.com/(?:files/(?P<id>\d*?)/(?P<name>[^?]+)|#!download\|(?:\w+)\|(?P<id_new>\d+)\|(?P<name_new>[^|]+))" +    __version__ = "1.34"      __description__ = """Rapidshare.com Download Hoster"""      __config__ = [["server", "Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera", "Preferred Server", "None"]]       __author_name__ = ("spoob", "RaNaN", "mkaay") | 
