diff options
-rw-r--r-- | module/config/core_default.xml | 10 | ||||
-rw-r--r-- | module/plugins/__init__.py | 1 | ||||
-rw-r--r-- | module/plugins/hoster/NetloadIn.py | 3 | ||||
-rw-r--r-- | module/thread_list.py | 10 | ||||
-rwxr-xr-x | pyLoadCore.py | 6 |
5 files changed, 13 insertions, 17 deletions
diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 4c95d5386..035b676f0 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -31,10 +31,8 @@ <language type="str" input="en;de;fr" name="Language">de</language> <download_folder type="str" name="Download Folder">Downloads</download_folder> <max_downloads type="int" name="Max Parallel Downloads">3</max_downloads> - <use_reconnect type="bool" name="Use Reconnect">False</use_reconnect> <link_file type="str" name="File For Links">links.txt</link_file> <failed_file type="str" name="File For Failed Links">failed_links.txt</failed_file> - <reconnect_method type="str" name="Reconnect Method">None</reconnect_method> <debug_mode type="bool" name="Debug Mode">False</debug_mode> <max_download_time type="int" name="Max Download Time">5</max_download_time> <download_speed_limit type="int" name="Download Speed Limit">0</download_speed_limit> @@ -44,9 +42,11 @@ <search_updates type="bool" name="Search">True</search_updates> <install_updates type="bool" name="Install">False</install_updates> </updates> - <reconnectTime name="Reconnect Time"> - <start type="time" name="Start">0:00</start> - <end type="time" name="End">0:00</end> + <reconnect name="Reconnect"> + <activated type="bool" name="Use Reconnect">False</activated> + <method type="str" name="Method">None</method> + <startTime type="time" name="Start">0:00</startTime> + <endTime type="time" name="End">0:00</endTime> </reconnectTime> <downloadTime name="Download Time"> <start type="time" name="Start">0:00</start> diff --git a/module/plugins/__init__.py b/module/plugins/__init__.py index e69de29bb..8b1378917 100644 --- a/module/plugins/__init__.py +++ b/module/plugins/__init__.py @@ -0,0 +1 @@ + diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 1f7e7d011..0e5245e9e 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -40,7 +40,6 @@ class NetloadIn(Plugin): self.req.clear_cookies() self.want_reconnect = False - self.download_api_data() if self.file_exists(): pyfile.status.filename = self.get_file_name() @@ -49,7 +48,6 @@ class NetloadIn(Plugin): self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) self.logger.info("Netload: Use Premium Account") pyfile.status.url = self.parent.url - #@TODO: premium?? return True self.download_html() @@ -73,7 +71,6 @@ class NetloadIn(Plugin): src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_data = {} if not src == "unknown file_data": - print "apidata:", src lines = src.split(";") self.api_data["exists"] = True self.api_data["fileid"] = lines[0] diff --git a/module/thread_list.py b/module/thread_list.py index d3eb4d203..5d0bcf53a 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -160,12 +160,12 @@ class Thread_List(object): def init_reconnect(self): """initialise a reonnect""" - if not self.parent.config['general']['use_reconnect'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): + if not self.parent.config['reconnect']['activated'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): return False - if not exists(self.parent.config['general']['reconnect_method']): - self.parent.logger.info(self.parent.config['general']['reconnect_method'] + " not found") - self.parent.config['general']['use_reconnect'] = False + if not exists(self.parent.config['reconnect']['method']): + self.parent.logger.info(self.parent.config['reconnect']['method'] + " not found") + self.parent.config['reconnect']['activated'] = False return False self.lock.acquire() @@ -200,7 +200,7 @@ class Thread_List(object): def reconnect(self): self.parent.logger.info("Start reconnect") - reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'])#, stdout=subprocess.PIPE) + reconn = subprocess.Popen(self.parent.config['activated']['method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" diff --git a/pyLoadCore.py b/pyLoadCore.py index 6eafee4ac..e586ee080 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -201,7 +201,6 @@ class Core(object): if self.config['webinterface']['activated']:
self.webserver = WebServer(self)
self.webserver.start()
-
def init_logger(self, level):
console = logging.StreamHandler(stdout)
@@ -217,7 +216,6 @@ class Core(object): self.logger.addHandler(console) #if console logging
self.logger.setLevel(level)
-
def init_scripts(self):
""" scan directory for scripts to execute"""
f = lambda x: False if x.startswith("#") or x.endswith("~") else True
@@ -604,8 +602,8 @@ class ServerMethods(): return self.core.compare_time(start, end)
def is_time_reconnect(self):
- start = self.core.config['reconnectTime']['start'].split(":")
- end = self.core.config['reconnectTime']['end'].split(":")
+ start = self.core.config['reconnect']['startTime'].split(":")
+ end = self.core.config['reconnect']['endTime'].split(":")
return self.core.compare_time(start, end)
if __name__ == "__main__":
|