From fd6e286ee089cf75276f2581471aba254d69fcb5 Mon Sep 17 00:00:00 2001
From: cp1
Date: Thu, 11 Jun 2009 16:50:48 +0200
Subject: correcting false identation (tabs to spaces)
---
Core.py | 35 +++++++++++++-------------
Plugins/BluehostTo.py | 6 ++---
Plugins/CCF.py | 2 +-
Plugins/MyvideoDe.py | 14 +++++------
Plugins/Plugin.py | 20 +++++++--------
Plugins/RSDF.py | 22 ++++++++--------
Plugins/RapidshareCom.py | 26 +++++++++----------
Plugins/ShragleCom.py | 2 +-
Plugins/UploadedTo.py | 16 ++++++------
Plugins/XupIn.py | 14 +++++------
Plugins/YoupornCom.py | 26 +++++++++----------
Plugins/YoutubeCom.py | 16 ++++++------
Plugins/ZippyshareCom.py | 14 +++++------
Plugins/ZshareNet.py | 14 +++++------
README | 2 +-
module/Py_Load_File.py | 5 ++--
module/__init__.py | 1 -
module/download_thread.py | 28 ++++++++++-----------
module/network/Keepalive.py | 46 +++++++++++++++++-----------------
module/network/MultipartPostHandler.py | 11 ++++----
module/network/Request.py | 34 ++++++++++++-------------
module/network/sslfactory.py | 12 ++++-----
module/remote/ClientSocket.py | 35 +++++++++++++-------------
module/remote/RequestHandler.py | 11 +++-----
module/remote/SocketServer.py | 6 ++---
module/thread_list.py | 43 ++++++++++++++++---------------
pluginconfig | 2 +-
pyMainGui.py | 30 +++++++++++-----------
sockettest.py | 2 +-
29 files changed, 243 insertions(+), 252 deletions(-)
diff --git a/Core.py b/Core.py
index d4cd3b588..25861c334 100644
--- a/Core.py
+++ b/Core.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
+# -*- coding: utf-8 -*-
+#
#Copyright (C) 2009 sp00b, sebnapi, RaNaN
#
#This program is free software; you can redistribute it and/or modify
@@ -41,7 +41,7 @@ from module.remote.SocketServer import ServerThread
from module.thread_list import Thread_List
class Core(object):
- """ pyLoad main
+ """ pyLoad main
"""
def __init__(self):
self.config = {}
@@ -52,7 +52,7 @@ class Core(object):
self.read_config()
- translation = gettext.translation("pyLoad", "locale", languages=[self.config['language']])
+ translation = gettext.translation("pyLoad", "locale", languages=[self.config['language']])
translation.install(unicode=True)
self.check_create(self.config['log_folder'], _("folder for logs"))
@@ -63,7 +63,7 @@ class Core(object):
self.init_logger(logging.DEBUG) # logging level
self.check_update()
-
+
self.logger.info(_("Downloadtime: %s") % self.is_dltime()) # debug only
self.thread_list = Thread_List(self)
@@ -72,7 +72,7 @@ class Core(object):
self.create_plugin_index()
self.init_server()
-
+
def read_config(self):
""" read config and sets preferences
"""
@@ -102,12 +102,12 @@ class Core(object):
""" funktion nur zum testen ohne gui bzw. tui
"""
links = open(link_file, 'r').readlines()
- self.extend_links(links)
+ self.extend_links(links)
def append_link(self, link):
if link not in self.thread_list.get_loaded_urls():
self.__new_py_load_file(link.replace("\n", ""))
-
+
def extend_links(self, links):
for link in links:
self.append_link(link)
@@ -134,22 +134,22 @@ class Core(object):
except:
print _("could not create %s") % legend
exit()
-
+
def __new_py_load_file(self, url):
new_file = PyLoadFile(self, url)
new_file.download_folder = self.config['download_folder']
self.thread_list.append_py_load_file(new_file)
return True
-
+
def init_logger(self, level):
file_handler = logging.handlers.RotatingFileHandler(self.config['log_folder'] + sep + 'log.txt', maxBytes=102400, backupCount=int(self.config['log_count'])) #100 kib * 5
- console = logging.StreamHandler(stdout)
+ console = logging.StreamHandler(stdout)
frm = logging.Formatter("%(asctime)s: %(levelname)-8s %(message)s", "%d.%m.%Y %H:%M:%S")
file_handler.setFormatter(frm)
console.setFormatter(frm)
-
+
self.logger = logging.getLogger("log") # settable in config
if self.config['file_log']:
@@ -193,18 +193,18 @@ class Core(object):
minutes, seconds = divmod(seconds, 60)
return "%.2i:%.2i:%.2i" % (hours, minutes, seconds)
return _("%i seconds") % seconds
-
+
def _test_print_status(self):
if self.thread_list.py_downloading:
-
+
for pyfile in self.thread_list.py_downloading:
if pyfile.status.type == 'downloading':
print pyfile.status.filename + ": speed is", int(pyfile.status.get_speed()), "kb/s"
print pyfile.status.filename + ": finished in", self.format_time(pyfile.status.get_ETA())
elif pyfile.status.type == 'waiting':
print pyfile.status.filename + ": wait", self.format_time(pyfile.status.waituntil - time.time())
-
+
def start(self):
""" starts the machine
"""
@@ -230,6 +230,5 @@ class Core(object):
self.server.start()
if __name__ == "__main__":
-
- testLoader = Core()
- testLoader.start()
+ testLoader = Core()
+ testLoader.start()
\ No newline at end of file
diff --git a/Plugins/BluehostTo.py b/Plugins/BluehostTo.py
index d7f9f1e81..c099d792f 100644
--- a/Plugins/BluehostTo.py
+++ b/Plugins/BluehostTo.py
@@ -20,7 +20,7 @@ class BluehostTo(Plugin):
self.parent = parent
self.html = None
self.multi_dl = False
-
+
def download_html(self):
url = self.parent.url
self.html = self.req.load(url)
@@ -33,7 +33,7 @@ class BluehostTo(Plugin):
"""
if self.html == None:
self.download_html()
-
+
inputs = re.findall(r"(<(input|form)[^>]+)", self.html)
for i in inputs:
if re.search(r"name=\"BluehostVers2dl\"",i[0]):
@@ -67,4 +67,4 @@ class BluehostTo(Plugin):
return True
def proceed(self, url, location):
- self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access})
+ self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access})
\ No newline at end of file
diff --git a/Plugins/CCF.py b/Plugins/CCF.py
index e583bfbb3..990e6a2ca 100644
--- a/Plugins/CCF.py
+++ b/Plugins/CCF.py
@@ -57,4 +57,4 @@ class CCF(Plugin):
self.links.append(tempdlc_name)
- return True
+ return True
\ No newline at end of file
diff --git a/Plugins/MyvideoDe.py b/Plugins/MyvideoDe.py
index 762cd77e0..b4427f0fc 100644
--- a/Plugins/MyvideoDe.py
+++ b/Plugins/MyvideoDe.py
@@ -4,7 +4,7 @@ import re
from Plugin import Plugin
class MyvideoDe(Plugin):
-
+
def __init__(self, parent):
Plugin.__init__(self, parent)
props = {}
@@ -19,7 +19,7 @@ class MyvideoDe(Plugin):
self.parent = parent
self.html = None
self.html_old = None #time() where loaded the HTML
- self.time_plus_wait = None #time() + wait in seconds
+ self.time_plus_wait = None #time() + wait in seconds
def set_parent_status(self):
""" sets all available Statusinfos about a File in self.parent.status
@@ -29,11 +29,11 @@ class MyvideoDe(Plugin):
self.parent.status.filename = self.get_file_name()
self.parent.status.url = self.get_file_url()
self.parent.status.wait = self.wait_until()
-
+
def download_html(self):
url = self.parent.url
self.html = self.req.load(url)
-
+
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
@@ -46,15 +46,15 @@ class MyvideoDe(Plugin):
print videoServer
print file_url
return file_url
-
+
def get_file_name(self):
if self.html == None:
self.download_html()
file_name_pattern = r"(.*)
"
return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv'
-
+
def file_exists(self):
- """ returns True or False
+ """ returns True or False
"""
if self.html == None:
self.download_html()
diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py
index c58976cd4..c1205e206 100644
--- a/Plugins/Plugin.py
+++ b/Plugins/Plugin.py
@@ -7,7 +7,7 @@ import re
from module.network.Request import Request
class Plugin():
-
+
def __init__(self, parent):
self.parser = ConfigParser.SafeConfigParser()
self.config = {}
@@ -26,23 +26,23 @@ class Plugin():
self.time_plus_wait = 0 #time() + wait in seconds
self.want_reconnect = False
self.multi_dl = True
-
+
def set_parent_status(self):
""" sets all available Statusinfos about a File in self.parent.status
"""
pass
-
+
def download_html(self):
""" gets the url from self.parent.url saves html in self.html and parses
- """
+ """
html = ""
self.html = html
-
+
def file_exists(self):
- """ returns True or False
+ """ returns True or False
"""
return True
-
+
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
@@ -50,12 +50,12 @@ class Plugin():
def get_file_name(self):
return re.findall("([^\/=]+)", self.parent.url)[-1]
-
+
def wait_until(self):
if self.html != None:
self.download_html()
return self.time_plus_wait
-
+
def proceed(self, url, location):
self.req.download(url, location)
@@ -75,4 +75,4 @@ class Plugin():
self.config[option] = False if self.config[option].lower() == 'false' else self.config[option]
def __call__(self):
- return self.props['name']
+ return self.props['name']
\ No newline at end of file
diff --git a/Plugins/RSDF.py b/Plugins/RSDF.py
index 74c07a007..d0ac3ec25 100644
--- a/Plugins/RSDF.py
+++ b/Plugins/RSDF.py
@@ -7,7 +7,7 @@ import binascii
from Plugin import Plugin
class RSDF(Plugin):
-
+
def __init__(self, parent):
Plugin.__init__(self, parent)
props = {}
@@ -22,38 +22,38 @@ class RSDF(Plugin):
self.parent = parent
self.multi_dl = True
self.links = []
-
+
def file_exists(self):
- """ returns True or False
+ """ returns True or False
"""
return True
def proceed(self, url, location):
try:
from Crypto.Cipher import AES
-
+
infile = url.replace("\n", "")
Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000')
-
+
IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF')
IV_Cipher = AES.new(Key, AES.MODE_ECB)
IV = IV_Cipher.encrypt(IV)
-
+
obj = AES.new(Key, AES.MODE_CFB, IV)
-
+
rsdf = open(infile, 'r')
-
+
data = rsdf.read()
data = binascii.unhexlify(''.join(data.split()))
data = data.splitlines()
-
+
for link in data:
link = base64.b64decode(link)
link = obj.decrypt(link)
decryptedUrl = link.replace('CCF: ', '')
self.links.append(decryptedUrl)
-
+
rsdf.close()
-
+
except:
print "Kein Crypto installiert, RSDF Plugin kann nicht genutzt werden"
diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py
index 362c2cf73..f7b981e37 100644
--- a/Plugins/RapidshareCom.py
+++ b/Plugins/RapidshareCom.py
@@ -8,7 +8,7 @@ from time import time
from Plugin import Plugin
class RapidshareCom(Plugin):
-
+
def __init__(self, parent):
Plugin.__init__(self, parent)
props = {}
@@ -41,10 +41,10 @@ class RapidshareCom(Plugin):
self.parent.status.filename = self.get_file_name()
self.parent.status.url = self.get_file_url()
self.parent.status.waituntil = self.wait_until()
-
+
def download_html(self):
""" gets the url from self.parent.url saves html in self.html and parses
- """
+ """
url = self.parent.url
html = self.req.load(url)
self.html[0] = html
@@ -59,7 +59,7 @@ class RapidshareCom(Plugin):
self.download_html()
if self.config['premium']:
- return False
+ return False
file_server_url = re.search(r"
)", self.html[0]) or \
re.search(r"(.*is momentarily not available.*)", self.html[0]) or \
re.search(r"(.*The uploader has removed this file from the server.*)", self.html[0]) or \
- re.search(r"(.*This file is suspected to contain illegal content.*)", self.html[0]):
- return False
+ re.search(r"(.*This file is suspected to contain illegal content.*)", self.html[0]):
+ return False
else:
return True
@@ -120,17 +120,17 @@ class RapidshareCom(Plugin):
return re.search(file_url_pattern, self.html[1]).group(1)
else:
return False
-
+
def get_file_name(self):
if self.html[0] == None:
self.download_html()
file_name_pattern = r".+/(.+)"
return re.search(file_url_pattern, self.html).group(1)
else:
return False
-
+
def get_file_name(self):
if self.html == None:
self.download_html()
@@ -56,9 +56,9 @@ class UploadedTo(Plugin):
return file_name
else:
return self.parent.url
-
+
def file_exists(self):
- """ returns True or False
+ """ returns True or False
"""
if self.html == None:
self.download_html()
@@ -70,4 +70,4 @@ class UploadedTo(Plugin):
def wait_until(self):
if self.html == None:
self.download_html()
- return self.time_plus_wait
+ return self.time_plus_wait
\ No newline at end of file
diff --git a/Plugins/XupIn.py b/Plugins/XupIn.py
index 21bcd3434..0f5c9a8b8 100644
--- a/Plugins/XupIn.py
+++ b/Plugins/XupIn.py
@@ -4,7 +4,7 @@ import re
from Plugin import Plugin
class XupIn(Plugin):
-
+
def __init__(self, parent):
Plugin.__init__(self, parent)
props = {}
@@ -23,24 +23,24 @@ class XupIn(Plugin):
self.posts = {}
self.want_reconnect = None
self.multi_dl = False
-
+
def download_html(self):
url = self.parent.url
self.html = self.req.load(url)
self.posts["vid"] = re.search('"hidden" value="(.*)" name="vid"', self.html).group(1)
self.posts["vtime"] = re.search('"hidden" value="(.*)" name="vtime"', self.html).group(1)
-
+
def get_file_url(self):
""" returns the absolute downloadable filepath
"""
if self.html == None:
self.download_html()
- if not self.want_reconnect:
+ if not self.want_reconnect:
file_url_pattern = r".*