diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-27 20:41:08 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-27 20:41:08 +0200 |
commit | ee5d7e788a7b0521b43a4158536021a12e14f2b1 (patch) | |
tree | b9d36e02cc5da5828eac617ca9aed23725399d3f /pyLoadCore.py | |
parent | some automatic fixes (diff) | |
download | pyload-ee5d7e788a7b0521b43a4158536021a12e14f2b1.tar.xz |
readded links txt parsing, catpcha error workaround
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py index ad4b0cc90..dd0c1f20f 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -200,6 +200,7 @@ class Core(object): #self.check_install("tesseract", _("tesseract for captcha reading"), False) self.check_file(self.config['general']['download_folder'], _("folder for downloads"), True) + self.check_file("links.txt", _("file for links")) if self.config['ssl']['activated']: self.check_install("OpenSSL", _("OpenSSL for secure connection"), True) @@ -243,7 +244,31 @@ class Core(object): self.hookManager.coreReady() self.config.save() #save so config files gets filled - + + link_file = join(pypath, "links.txt") + + if exists(link_file): + f = open(link_file, "rb") + links = [x.strip() for x in f.readlines() if x.strip()] + if links: + self.server_methods.add_package("links.txt", links) + f.close() + try: + f = open(link_file, "wb") + f.close() + except: + pass + + link_file = "links.txt" + if exists(link_file): + f = open(link_file, "rb") + links = [x.strip() for x in f.readlines() if x.strip()] + if links: + self.server_methods.add_package("links.txt", links) + f.close() + f = open(link_file, "wb") + f.close() + while True: sleep(2) |