diff options
| -rw-r--r-- | module/plugins/hoster/FreakshareCom.py | 10 | ||||
| -rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 33 | ||||
| -rw-r--r-- | module/plugins/hoster/ShragleCom.py | 48 | 
3 files changed, 58 insertions, 33 deletions
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index bbc22ac98..441bdcd8f 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -21,6 +21,7 @@ class FreakshareCom(Hoster):          self.req_opts = []      def process(self, pyfile): +        self.pyfile = pyfile          pyfile.url = pyfile.url.replace("freakshare.net/","freakshare.com/")          if self.account: @@ -54,7 +55,7 @@ class FreakshareCom(Hoster):          return True      def download_html(self): -        self.html = self.load(url, cookies=True) +        self.html = self.load(self.pyfile.url, cookies=True)      def get_file_url(self):          """ returns the absolute downloadable filepath @@ -112,9 +113,16 @@ class FreakshareCom(Hoster):          herewego = self.load(self.pyfile.url, None, request_options, cookies=True) # the actual download-Page +        # comment this in, when it doesnt work +        # with open("DUMP__FS_.HTML", "w") as fp: +            # fp.write(herewego) +                  to_sort = re.findall(r"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego)          request_options = [] +        # comment this in, when it doesnt work as well +        #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) +                  for item in to_sort:       #Same as above              request_options.append((item[1], item[0])) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 77bc24182..a01dd86a3 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -16,7 +16,7 @@ def getInfo(urls):      api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php"      for chunk in chunks(urls, 90): -        api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","") for x in chunk)} #api only supports old style links +        api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","").rstrip("/") for x in chunk)} #api only supports old style links          src = getURL(api_url_base, post=api_param_file)          result = []          for i, res in enumerate(src.split("\n")): @@ -82,20 +82,30 @@ class ShareonlineBiz(Hoster):                  self.log.info("%s: no free slots, waiting 120 seconds" % (self.__name__))                  self.wait()                  self.retry() -            captcha = self.decryptCaptcha("http://www.share-online.biz/captcha.php", get={"rand":"0.%s" % random.randint(10**15,10**16)}, cookies=True) -            self.log.debug("%s Captcha: %s" % (self.__name__, captcha)) -            sleep(3) +            return True +             +             +            # captcha = self.decryptCaptcha("http://www.share-online.biz/captcha.php", get={"rand":"0.%s" % random.randint(10**15,10**16)}, cookies=True) +                 +            # self.log.debug("%s Captcha: %s" % (self.__name__, captcha)) +            # sleep(3) -            html = self.load(self.pyfile.url, post={"captchacode": captcha}, cookies=True) -            if re.search(r"Der Download ist Ihnen zu langsam", html): -                #m = re.search("var timeout='(\d+)';", self.html[1]) -                #self.waitUntil = time() + int(m.group(1)) if m else 30 -                return True +            # html = self.load(self.pyfile.url, post={"captchacode": captcha}, cookies=True) +            # return True +             +             +            #m = re.search("var timeout='(\d+)';", self.html[1]) +            #self.waitUntil = time() + int(m.group(1)) if m else 30 +            # if r"Der Download ist Ihnen zu langsam" in html: +                # return True +            # if r"The download is too slow for you" in html: +                # return True +                              self.retry()          else: -            if r"Die Nummer ist leider nicht richtig oder ausgelaufen!" in html: +            if r"Die Nummer ist leider nicht richtig oder ausgelaufen!" in self.html:                  self.retry()              return True @@ -106,13 +116,14 @@ class ShareonlineBiz(Hoster):          else:              self.pyfile.url = self.pyfile.url.replace("http://www.share-online.biz/download.php?id=", "http://www.share-online.biz/dl/")              self.pyfile.url = self.pyfile.url.replace("http://share-online.biz/download.php?id=", "http://www.share-online.biz/dl/") +                  def getFileUrl(self):          """ returns the absolute downloadable filepath          """          if self.account:              return re.search('<b>The following link contains a ticket to a valid mirror for your desired file\.</b>.*?<a href="(.*?)" onmouseout', self.html, re.S).group(1) -        file_url_pattern = 'loadfilelink\.decode\("([^"]+)' +        file_url_pattern = r'var\sdl="(.*?)"'          return b64decode(re.search(file_url_pattern, self.html).group(1))      def checksum(self, local_file): diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py index 65d2787f0..f45c94e96 100644 --- a/module/plugins/hoster/ShragleCom.py +++ b/module/plugins/hoster/ShragleCom.py @@ -15,25 +15,31 @@ class ShragleCom(Hoster):      __author_name__ = ("RaNaN")      __author_mail__ = ("RaNaN@pyload.org") -    def __init__(self, parent): -        Hoster.__init__(self, parent) -        self.parent = parent +    def setup(self):          self.html = None -        self.multi_dl = False +        self.multiDL = False +         +    def process(self, pyfile): +        self.pyfile = pyfile +         +        if not self.file_exists(): +            self.offline() +             +        self.pyfile.name = self.get_file_name() +         +        self.setWait(self.get_waiting_time()) +        self.wait() +         +        self.proceed(self.get_file_url()) -    def set_parent_status(self): -        """ sets all available Statusinfos about a File in self.parent.status -        """ +    def get_waiting_time(self):          if self.html is None:              self.download_html() -        self.parent.status.filename = self.get_file_name() -        self.parent.status.url = self.get_file_url() -        self.parent.status.wait = self.wait_until() +             +        return int(re.search('Please wait (\d+) seconds', self.html).group(1))      def download_html(self): -        url = self.parent.url -        self.html = self.load(url) -        self.time_plus_wait = time.time() + 10 +        self.html = self.load(self.pyfile.url)      def get_file_url(self):          """ returns the absolute downloadable filepath @@ -41,12 +47,12 @@ class ShragleCom(Hoster):          if self.html is None:              self.download_html() -        self.fileID = re.search(r"name=\"fileID\" value=\"([^\"]+)", self.html).group(1) -        self.dlSession = re.search(r"name=\"dlSession\" value=\"([^\"]+)", self.html).group(1) -        self.userID = "" -        self.password = "" -        self.lang = "de" -        return "http://srv4.shragle.com/download.php" +        self.fileID = re.search(r'name="fileID"\svalue="(.*?)"', self.html).group(1) +        self.dlSession = re.search(r'name="dlSession"\svalue="(.*?)"', self.html).group(1) +        self.userID = re.search(r'name="userID"\svalue="(.*?)"', self.html).group(1) +        self.password = re.search(r'name="password"\svalue="(.*?)"', self.html).group(1) +        self.lang = re.search(r'name="lang"\svalue="(.*?)"', self.html).group(1) +        return re.search(r'id="download"\saction="(.*?)"', self.html).group(1)      def get_file_name(self):          if self.html is None: @@ -66,5 +72,5 @@ class ShragleCom(Hoster):          else:              return True -    def proceed(self, url, location): -        self.download(url, location, {'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang}) +    def proceed(self, url): +        self.download(url, post={'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang})  | 
