summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Plugins/LixIn.py37
-rw-r--r--Plugins/ZippyshareCom.py9
-rwxr-xr-xmodule/network/Request.py28
-rw-r--r--module/thread_list.py4
-rw-r--r--pyLoadCore.py2
5 files changed, 68 insertions, 12 deletions
diff --git a/Plugins/LixIn.py b/Plugins/LixIn.py
new file mode 100644
index 000000000..409c72f6d
--- /dev/null
+++ b/Plugins/LixIn.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.unescape import unescape
+from Plugin import Plugin
+
+class LixIn(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "LixIn"
+ props['type'] = "container"
+ props['pattern'] = r"http://(www.)?lix.in/"
+ props['version'] = "0.1"
+ props['description'] = """Lix.in Container Plugin"""
+ props['author_name'] = ("spoob")
+ props['author_mail'] = ("spoob@pyload.org")
+ self.props = props
+ self.parent = parent
+ self.html = None
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ return True
+
+ def proceed(self, url, location):
+ url = self.parent.url
+ self.html = self.req.load(url)
+ new_link = ""
+ if not re.search("captcha_img.php", self.html):
+ new_link = re.search(r".*<iframe name=\"ifram\" src=\"(.*)\" marginwidth=\"0\".*", self.req.load(url, post={"submit" : "continue"})).group(1)
+
+ self.links = [new_link]
diff --git a/Plugins/ZippyshareCom.py b/Plugins/ZippyshareCom.py
index 4e69a5155..d61841ab0 100644
--- a/Plugins/ZippyshareCom.py
+++ b/Plugins/ZippyshareCom.py
@@ -26,7 +26,7 @@ class ZippyshareCom(Plugin):
def download_html(self):
url = self.parent.url
- self.html = self.req.load(url)
+ self.html = self.req.load(url, cookies=True)
self.time_plus_wait = time() + 12
def get_file_url(self):
@@ -35,7 +35,7 @@ class ZippyshareCom(Plugin):
if self.html == None:
self.download_html()
if not self.want_reconnect:
- file_url = urllib.unquote(re.search("var comeonguys = 'fck(.*)';", self.html).group(1))
+ file_url = urllib.unquote(re.search("var \w* = 'fck(.*)';", self.html).group(1))
return file_url
else:
return False
@@ -45,7 +45,6 @@ class ZippyshareCom(Plugin):
self.download_html()
if not self.want_reconnect:
file_name = re.search("<strong>Name: </strong>(.*)</font><br />", self.html).group(1)
- print "zippy",file_name
return file_name
else:
return self.parent.url
@@ -59,3 +58,7 @@ class ZippyshareCom(Plugin):
return False
else:
return True
+
+ def proceed(self, url, location):
+
+ self.req.download(url, location, cookies=True)
diff --git a/module/network/Request.py b/module/network/Request.py
index cce89f92e..2b3545dd8 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -71,12 +71,9 @@ class Request:
url = url + get
req = urllib2.Request(url, data=post)
-
-
if ref and self.lastURL is not None:
req.add_header("Referer", self.lastURL)
-
if cookies:
self.add_cookies(req)
#add cookies
@@ -112,17 +109,36 @@ class Request:
self.opener.add_handler(handler)
self.downloader.add_handler(handler)
- def download(self, url, filename, post={}):
+ def download(self, url, filename, get={}, post={}, ref=True, cookies=False):
if post:
post = urllib.urlencode(post)
else:
post = None
+ if get:
+ get = urllib.urlencode(get)
+ else:
+ get = ""
+
+ url = url + get
+ req = urllib2.Request(url, data=post)
+
+ if ref and self.lastURL is not None:
+ req.add_header("Referer", self.lastURL)
+
+ if cookies:
+ self.add_cookies(req)
+ #add cookies
+
+ rep = self.opener.open(req)
+
+ for cookie in self.cj.make_cookies(rep, req):
+ self.cookies.append(cookie)
+
if not self.dl:
self.dl = True
file = open(filename, 'wb')
- req = urllib2.Request(url)
conn = self.downloader.open(req, post)
if conn.headers.has_key("content-length"):
self.dl_size = int(conn.headers["content-length"])
@@ -155,4 +171,4 @@ class Request:
if __name__ == "__main__":
import doctest
- doctest.testmod() \ No newline at end of file
+ doctest.testmod()
diff --git a/module/thread_list.py b/module/thread_list.py
index a7e92b77d..677fe7ecc 100644
--- a/module/thread_list.py
+++ b/module/thread_list.py
@@ -117,8 +117,8 @@ class Thread_List(object):
data = data.replace(pyfile.url + '\n', "")
- with open(self.parent.config['link_file'], 'w') as f:
- f.write(data)
+ #with open(self.parent.config['link_file'], 'w') as f:
+ #f.write(data)
if pyfile.status.type == "reconnected":#put it back in queque
self.py_load_files.insert(0, pyfile)
diff --git a/pyLoadCore.py b/pyLoadCore.py
index f85f5b447..159ef1366 100644
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -68,7 +68,7 @@ class Core(object):
self.thread_list = Thread_List(self)
- self.file_list = file_list.load()
+ self.file_list = file_list.load(self)
path.append(self.config['plugin_folder'])
self.create_plugin_index()