summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-27 20:41:08 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-27 20:41:08 +0200
commitee5d7e788a7b0521b43a4158536021a12e14f2b1 (patch)
treeb9d36e02cc5da5828eac617ca9aed23725399d3f /pyLoadCore.py
parentsome automatic fixes (diff)
downloadpyload-ee5d7e788a7b0521b43a4158536021a12e14f2b1.tar.xz
readded links txt parsing, catpcha error workaround
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py27
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)