diff options
Diffstat (limited to 'module')
| -rw-r--r-- | module/gui/CNLServer.py | 12 | ||||
| -rwxr-xr-x | module/network/Request.py | 12 | ||||
| -rw-r--r-- | module/plugins/hoster/BasePlugin.py | 2 | ||||
| -rw-r--r-- | module/plugins/hoster/RapidshareCom.py | 4 | 
4 files changed, 22 insertions, 8 deletions
diff --git a/module/gui/CNLServer.py b/module/gui/CNLServer.py index 7f7dc29ed..df9cd361d 100644 --- a/module/gui/CNLServer.py +++ b/module/gui/CNLServer.py @@ -45,11 +45,16 @@ class CNLServer(Thread):          self.setDaemon(True)          self.stop = False -        self.stopped = True +        self.stopped = False      def run(self):          server_address = ('127.0.0.1', 9666) -        httpd = HTTPServer(server_address, CNLHandler) +        try: +            httpd = HTTPServer(server_address, CNLHandler) +        except: +            self.stopped = True +            return +                  self.stopped = False          while self.keep_running():              httpd.handle_request() @@ -212,9 +217,10 @@ if __name__ == "__main__":      s = CNLServer()      s.start() -    while not s.stop: +    while not s.stopped:          try:              s.join(1)          except KeyboardInterrupt:              s.stop = True +            s.stopped = True              print "quiting.."
\ No newline at end of file diff --git a/module/network/Request.py b/module/network/Request.py index f9941d74c..c76590afc 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -126,7 +126,7 @@ class Request:          return None      def load(self, url, get={}, post={}, ref=True, cookies=True, just_header=False, no_post_encode=False): -         +          self.pycurl.setopt(pycurl.NOPROGRESS, 1)          url = self.__myquote(str(url)) @@ -144,7 +144,7 @@ class Request:              get = ""          self.pycurl.setopt(pycurl.URL, url) -        self.pycurl.setopt(pycurl.WRITEFUNCTION, self.rep.write) +        self.pycurl.setopt(pycurl.WRITEFUNCTION, self.write_rep)          if cookies:              self.curl_enable_cookies() @@ -333,6 +333,14 @@ class Request:      def write_header(self, string):          self.header += string +    def write_rep(self, buf): +        if self.rep.tell() > 180000 or self.abort: +            if self.abort: raise Abort +            print self.rep.getvalue() +            raise Exception("Loaded Url exceeded limit") + +        self.rep.write(buf) +      def get_rep(self):          value = self.rep.getvalue()          self.rep.close() diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 4701f82ca..292570d6c 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -15,7 +15,7 @@ class BasePlugin(Hoster):      def process(self, pyfile):          """main function""" -         +          if pyfile.url.startswith("http"):              pyfile.name = re.findall("([^/=]+)", pyfile.url)[-1] diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index f96e5cd85..2e6ada837 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -176,9 +176,9 @@ class RapidshareCom(Hoster):      def freeWait(self):          """downloads html with the important information          """ -        self.html = self.load("http://rapidshare.com/files/%s/%s" % (self.id, self.name),ref=False) +        #self.html = self.load("http://rapidshare.com/files/%s/%s" % (self.id, self.name),ref=False) -        sleep(1) +        #sleep(1)          self.no_download = True  | 
