summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar spoob <spoob@gmx.de> 2009-06-14 02:32:26 +0200
committerGravatar spoob <spoob@gmx.de> 2009-06-14 02:32:26 +0200
commit6cad171c269c07d5b365ffba7b676f25e98e449f (patch)
tree14980a9a6bf91ddd6030c0e252e4ffe4c435b4d9
parentadded 1kh.de container plugin (diff)
downloadpyload-6cad171c269c07d5b365ffba7b676f25e98e449f.tar.xz
added 1kh.de container plugin
-rw-r--r--Plugins/BluehostTo.py3
-rw-r--r--Plugins/UploadedTo.py4
-rw-r--r--Plugins/XupIn.py2
-rw-r--r--Plugins/ZippyshareCom.py4
-rw-r--r--Plugins/ZshareNet.py4
-rw-r--r--module/unescape.py38
6 files changed, 46 insertions, 9 deletions
diff --git a/Plugins/BluehostTo.py b/Plugins/BluehostTo.py
index 3b8d7b6be..1ecd47122 100644
--- a/Plugins/BluehostTo.py
+++ b/Plugins/BluehostTo.py
@@ -28,7 +28,6 @@ class BluehostTo(Plugin):
self.html = self.req.load(url)
time.sleep(1.5)
self.html = self.req.load(url, cookies=True)
- print self.html
def get_file_url(self):
""" returns the absolute downloadable filepath
@@ -69,4 +68,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}) \ No newline at end of file
+ self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access})
diff --git a/Plugins/UploadedTo.py b/Plugins/UploadedTo.py
index ba1487abe..8df8db110 100644
--- a/Plugins/UploadedTo.py
+++ b/Plugins/UploadedTo.py
@@ -17,7 +17,7 @@ class UploadedTo(Plugin):
props['description'] = """Uploaded.to Download Plugin"""
props['author_name'] = ("spoob")
props['author_mail'] = ("spoob@pyload.org")
- self.plugin_config = props
+ self.props = props
self.parent = parent
self.html = None
self.html_old = None #time() where loaded the HTML
@@ -71,4 +71,4 @@ class UploadedTo(Plugin):
def wait_until(self):
if self.html == None:
self.download_html()
- return self.time_plus_wait \ No newline at end of file
+ return self.time_plus_wait
diff --git a/Plugins/XupIn.py b/Plugins/XupIn.py
index 092d525c9..6b1f3be73 100644
--- a/Plugins/XupIn.py
+++ b/Plugins/XupIn.py
@@ -16,7 +16,7 @@ class XupIn(Plugin):
props['description'] = """Xup.in Download Plugin"""
props['author_name'] = ("spoob")
props['author_mail'] = ("spoob@pyload.org")
- self.plugin_config = props
+ self.props = props
self.parent = parent
self.html = None
self.html_old = None #time() where loaded the HTML
diff --git a/Plugins/ZippyshareCom.py b/Plugins/ZippyshareCom.py
index d4ea43a6f..4e69a5155 100644
--- a/Plugins/ZippyshareCom.py
+++ b/Plugins/ZippyshareCom.py
@@ -18,7 +18,7 @@ class ZippyshareCom(Plugin):
props['description'] = """Zippyshare.com Download Plugin"""
props['author_name'] = ("spoob")
props['author_mail'] = ("spoob@pyload.org")
- self.plugin_config = props
+ self.props = props
self.parent = parent
self.html = None
self.want_reconnect = False
@@ -58,4 +58,4 @@ class ZippyshareCom(Plugin):
if re.search(r"HTTP Status 404", self.html) != None:
return False
else:
- return True \ No newline at end of file
+ return True
diff --git a/Plugins/ZshareNet.py b/Plugins/ZshareNet.py
index 39ec34658..33667605f 100644
--- a/Plugins/ZshareNet.py
+++ b/Plugins/ZshareNet.py
@@ -16,7 +16,7 @@ class ZshareNet(Plugin):
props['description'] = """Zshare.net Download Plugin"""
props['author_name'] = ("spoob")
props['author_mail'] = ("spoob@pyload.org")
- self.plugin_config = props
+ self.props = props
self.parent = parent
self.html = [None, None]
self.html_old = None #time() where loaded the HTML
@@ -69,4 +69,4 @@ class ZshareNet(Plugin):
def wait_until(self):
if self.html[0] == None:
self.download_html()
- return self.time_plus_wait \ No newline at end of file
+ return self.time_plus_wait
diff --git a/module/unescape.py b/module/unescape.py
new file mode 100644
index 000000000..462423b03
--- /dev/null
+++ b/module/unescape.py
@@ -0,0 +1,38 @@
+import re
+
+def unescape(text):
+ """Removes HTML or XML character references
+ and entities from a text string.
+ keep &amp;, &gt;, &lt; in the source code.
+ from Fredrik Lundh
+ http://effbot.org/zone/re-sub.htm#unescape-html
+ """
+ def fixup(m):
+ text = m.group(0)
+ if text[:2] == "&#":
+ # character reference
+ try:
+ if text[:3] == "&#x":
+ return unichr(int(text[3:-1], 16))
+ else:
+ return unichr(int(text[2:-1]))
+ except ValueError:
+ print "erreur de valeur"
+ pass
+ else:
+ # named entity
+ try:
+ if text[1:-1] == "amp":
+ text = "&amp;amp;"
+ elif text[1:-1] == "gt":
+ text = "&amp;gt;"
+ elif text[1:-1] == "lt":
+ text = "&amp;lt;"
+ else:
+ print text[1:-1]
+ text = unichr(htmlentitydefs.name2codepoint[text[1:-1]])
+ except KeyError:
+ print "keyerror"
+ pass
+ return text # leave as is
+ return str(re.sub("&#?\w+;", fixup, text))