From 6b5d39a18461a45e53fd4048e1ac6a5cbd075b8c Mon Sep 17 00:00:00 2001
From: spoob
.+/(.+) ", self.req.load("http://relink.us/f/%s/1/%i" % (container_id, number))).group(1)
- temp_links.append(new_link)
- print temp_links
- self.links = temp_links
diff --git a/Plugins/ShareonlineBiz.py b/Plugins/ShareonlineBiz.py
deleted file mode 100644
index d42ef9302..000000000
--- a/Plugins/ShareonlineBiz.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import os
-import re
-import tempfile
-from time import time
-from base64 import b64decode
-
-from Plugin import Plugin
-
-class ShareonlineBiz(Plugin):
-
- def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "ShareonlineBiz"
- props['type'] = "hoster"
- props['pattern'] = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id="
- props['version'] = "0.1"
- props['description'] = """Shareonline.biz Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
- self.parent = parent
- self.html = [None, None]
- self.want_reconnect = False
- self.init_ocr()
- self.multi_dl = False
-
- def download_html(self):
- url = self.parent.url
- self.html[0] = self.req.load(url, cookies=True)
-
- captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name
-
- for i in range(5):
- self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True)
- captcha = self.ocr.get_captcha(captcha_image)
- self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True)
- if re.search(r"Der Download ist Ihnen zu langsam?", self.html[1]) != None:
- self.time_plus_wait = time() + 15
- break
-
- os.remove(captcha_image)
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html[0] == None:
- self.download_html()
- if not self.want_reconnect:
- file_url_pattern = 'loadfilelink\.decode\("(.*==)"\);'
- return b64decode(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()
- if not self.want_reconnect:
- file_name_pattern = 'class="locatedActive">Download (.*)'
- return re.search(file_name_pattern, self.html[1]).group(1)
- else:
- return self.parent.url
-
- def file_exists(self):
- """ returns True or False
- """
- if self.html[0] == None:
- self.download_html()
- if re.search(r"nicht zum Download bereitgestellt werden", self.html[0]) != None:
- return False
- else:
- return True
diff --git a/Plugins/ShragleCom.py b/Plugins/ShragleCom.py
deleted file mode 100644
index bcf650d69..000000000
--- a/Plugins/ShragleCom.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-import time
-
-from Plugin import Plugin
-
-class ShragleCom(Plugin):
-
- def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "ShragleCom"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www.)?shragle.com/files/"
- props['version'] = "0.1"
- props['description'] = """Shragle Download PLugin"""
- props['author_name'] = ("RaNaN")
- props['author_mail'] = ("RaNaN@pyload.org")
- self.props = props
- self.parent = parent
- self.html = None
- self.multi_dl = False
-
- def set_parent_status(self):
- """ sets all available Statusinfos about a File in self.parent.status
- """
- if self.html == None:
- self.download_html()
- 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)
- self.time_plus_wait = time.time() + 10
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html == None:
- self.download_html()
-
- self.fileID = re.search(r"name=\"fileID\" value=\"([^\"]+)", self.html).group(1)
- self.dlSession = re.search(r"name=\"dlSession\" value=\"([^\"]+)", self.html).group(1)
- self.userID = ""
- self.password = ""
- self.lang = "de"
- return "http://srv4.shragle.com/download.php"
-
- def get_file_name(self):
- if self.html == None:
- self.download_html()
-
- file_name_pattern = r"<\/div>(.+)<\/h2"
- return re.search(file_name_pattern, self.html).group(1)
-
- def file_exists(self):
- """ returns True or False
- """
- if self.html == None:
- self.download_html()
-
- if re.search(r"html", self.html) == None:
- return False
- else:
- return True
-
- def proceed(self, url, location):
- self.req.download(url, location, {'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang})
\ No newline at end of file
diff --git a/Plugins/StealthTo.py b/Plugins/StealthTo.py
deleted file mode 100644
index c904a07c3..000000000
--- a/Plugins/StealthTo.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-
-from Plugin import Plugin
-
-class StealthTo(Plugin):
-
- def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "StealthTo"
- props['type'] = "container"
- props['pattern'] = r"http://(www\.)?stealth.to/folder/"
- props['version'] = "0.1"
- props['description'] = """Stealth.to 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, cookies=True)
- temp_links = []
- ids = []
- ats = [] # authenticity_token
- inputs = re.findall(r"(<(input|form)[^>]+)", self.html)
- for input in inputs:
- if re.search(r"name=\"authenticity_token\"",input[0]):
- ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1))
- if re.search(r"name=\"id\"",input[0]):
- ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1))
-
- for i in range(0, len(ids)):
- self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True)
- new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, cookies=True)
- temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1))
-
- self.links = temp_links
diff --git a/Plugins/UploadedTo.py b/Plugins/UploadedTo.py
deleted file mode 100644
index e65be789c..000000000
--- a/Plugins/UploadedTo.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from time import time
-from Plugin import Plugin
-
-class UploadedTo(Plugin):
-
- def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "UploadedTo"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/"
- props['version'] = "0.1"
- props['description'] = """Uploaded.to Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
- 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.want_reconnect = None
- self.multi_dl = False
-
- def prepare(self, thread):
- pyfile = self.parent
-
- self.want_reconnect = False
- tries = 0
-
- while not pyfile.status.url:
-
- self.download_html()
-
- pyfile.status.exists = self.file_exists()
-
- if not pyfile.status.exists:
- raise Exception, "The file was not found on the server."
-
- pyfile.status.filename = self.get_file_name()
-
- pyfile.status.waituntil = self.time_plus_wait
- pyfile.status.url = self.get_file_url()
- pyfile.status.want_reconnect = self.want_reconnect
-
- thread.wait(self.parent)
-
- pyfile.status.filename = self.get_file_name()
-
- tries += 1
- if tries > 5:
- raise Exception, "Error while preparing DL, HTML dump: %s" % self.html
-
- return True
-
- def download_html(self):
- url = self.parent.url
- self.html = self.req.load(url)
-
- try:
- wait_minutes = re.search(r"Or wait ([\d\-]+) minutes", self.html).group(1)
- if int(wait_minutes) < 0: wait_minutes = 1
- self.time_plus_wait = time() + 60 * int(wait_minutes)
- self.want_reconnect = True
- except:
- self.time_plus_wait = 0
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- try:
- file_url_pattern = r".*
\s+(.+)\s", self.html).group(1)
- file_suffix = re.search(r" (\..+) ", self.html)
- if not file_suffix:
- return file_name
- return file_name + file_suffix.group(1)
- except:
- self.parent.status.url = None
- return self.parent.url
-
- def file_exists(self):
- """ returns True or False
- """
- if re.search(r"(File doesn't exist .*)", self.html) != None:
- return False
- else:
- return True
diff --git a/Plugins/XupIn.py b/Plugins/XupIn.py
deleted file mode 100644
index 6b1f3be73..000000000
--- a/Plugins/XupIn.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from Plugin import Plugin
-
-class XupIn(Plugin):
-
- def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "XupIn"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www.)?xup.in/"
- props['version'] = "0.1"
- props['description'] = """Xup.in Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
- 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.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:
- file_url_pattern = r".*
", self.html).group(1)
- return file_name
- else:
- return self.parent.url
-
- def file_exists(self):
- """ returns True or False
- """
- if self.html == None:
- self.download_html()
- if re.search(r"HTTP Status 404", self.html) != None:
- return False
- else:
- return True
-
- def proceed(self, url, location):
-
- self.req.download(url, location, cookies=True)
diff --git a/Plugins/ZshareNet.py b/Plugins/ZshareNet.py
deleted file mode 100644
index 33667605f..000000000
--- a/Plugins/ZshareNet.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from Plugin import Plugin
-
-class ZshareNet(Plugin):
-
- def __init__(self, parent):
- Plugin.__init__(self, parent)
- props = {}
- props['name'] = "ZshareNet"
- props['type'] = "hoster"
- props['pattern'] = r"http://(?:www.)?zshare.net/"
- props['version'] = "0.1"
- props['description'] = """Zshare.net Download Plugin"""
- props['author_name'] = ("spoob")
- props['author_mail'] = ("spoob@pyload.org")
- self.props = props
- self.parent = parent
- self.html = [None, None]
- self.html_old = None #time() where loaded the HTML
- self.time_plus_wait = None #time() + wait in seconds
- self.posts = {}
- self.want_reconnect = False
- self.multi_dl = False
-
- def download_html(self):
- url = self.parent.url
- self.html[0] = self.req.load(url)
- if "/video/" in url:
- url = url.replace("/video/", "/download/")
- elif "/audio/" in url:
- url = url.replace("/audio/", "/download/")
- elif "/image/" in url:
- url = url.replace("/image/", "/download/")
- self.html[1] = self.req.load(url, None, {"download": "1"})
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html[0] == None:
- self.download_html()
- if not self.want_reconnect:
- file_url = "".join(eval(re.search("var link_enc=new Array(.*);link", self.html[1]).group(1)))
- return file_url
- else:
- return False
-
- def get_file_name(self):
- if self.html[0] == None:
- self.download_html()
- if not self.want_reconnect:
- file_name = re.search("(.*)", self.html[0]).group(1)
- return file_name
- else:
- return self.parent.url
-
- def file_exists(self):
- """ returns True or False
- """
- if self.html[0] == None:
- self.download_html()
- if re.search(r"File Not Found", self.html[0]) != None:
- return False
- else:
- return True
-
- def wait_until(self):
- if self.html[0] == None:
- self.download_html()
- return self.time_plus_wait
diff --git a/Plugins/__init__.py b/Plugins/__init__.py
deleted file mode 100644
index 8d1c8b69c..000000000
--- a/Plugins/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/config b/config
index 1982bf6ac..f408b2f22 100644
--- a/config
+++ b/config
@@ -3,7 +3,7 @@ port = 7272
password = pwhere
[webinterface]
-activated = True
+activated = False
port = 8080
username = User
password = webpw
@@ -24,7 +24,7 @@ reconnect_method = reconnect_method
debug_mode = False
[updates]
-search_updates = asdf
+search_updates = True
install_updates = False
[reconnectTime]
diff --git a/module/network/Request.py b/module/network/Request.py
index b2bac2d7b..084c84f95 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -244,7 +244,6 @@ class Request:
if "..." in file_name:
download_folder = dirname(file_name) + sep
headers = self.get_header()
- print headers
file_name_search = re.search('filename=(?P\")?(.+)(?(quote)\")', headers)
if file_name_search:
file_name = file_name_search.group(2)
diff --git a/module/plugins/BluehostTo.py b/module/plugins/BluehostTo.py
new file mode 100644
index 000000000..1ecd47122
--- /dev/null
+++ b/module/plugins/BluehostTo.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import time
+
+from Plugin import Plugin
+
+class BluehostTo(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "BluehostTo"
+ props['type'] = "hoster"
+ props['pattern'] = r"http://(?:www.)?bluehost.to/file/"
+ props['version'] = "0.1"
+ props['description'] = """Bluehost Download PLugin"""
+ props['author_name'] = ("RaNaN")
+ props['author_mail'] = ("RaNaN@pyload.org")
+ self.props = props
+ self.parent = parent
+ self.html = None
+ self.multi_dl = False
+
+ def download_html(self):
+ url = self.parent.url
+ self.html = self.req.load(url)
+ time.sleep(1.5)
+ self.html = self.req.load(url, cookies=True)
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ 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]):
+ self.BluehostVers2dl = re.search(r"value=\"([^\"]+)", i[0]).group(1)
+ elif re.search(r"name=\"PHPSESSID\"",i[0]):
+ self.PHPSESSID = re.search(r"value=\"([^\"]+)", i[0]).group(1)
+ elif re.search(r"name=\"DownloadV2Hash\"",i[0]):
+ self.DownloadV2Hash = re.search(r"value=\"([^\"]+)", i[0]).group(1)
+ elif re.search(r"name=\"access\"",i[0]):
+ self.access = re.search(r"value=\"([^\"]+)", i[0]).group(1)
+ elif re.search(r"name=\"download\"",i[0]):
+ url = re.search(r"action=\"([^\"]+)", i[0]).group(1)
+
+ return url
+
+ def get_file_name(self):
+ if self.html == None:
+ self.download_html()
+ file_name_pattern = r"
", self.html).group(1)
+ tmp = re.findall('Part \d+', download_content)
+ if tmp == []: continue
+ for link in tmp:
+ link_html = self.req.load(link, cookies=True)
+ temp_links.append(re.search('(.*)
"
+ return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv'
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html == None:
+ self.download_html()
+ if re.search(r"(.* Das angeforderte Video ist nicht.*)", self.html) != None:
+ return False
+ else:
+ return True
diff --git a/module/plugins/NetloadIn.py b/module/plugins/NetloadIn.py
new file mode 100644
index 000000000..789c84a2d
--- /dev/null
+++ b/module/plugins/NetloadIn.py
@@ -0,0 +1,136 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import os
+import re
+import tempfile
+from time import time
+from time import sleep
+
+from Plugin import Plugin
+
+class NetloadIn(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "NetloadIn"
+ props['type'] = "hoster"
+ props['pattern'] = r"http://.*netload\.in/"
+ props['version'] = "0.1"
+ props['description'] = """Netload.in Download Plugin"""
+ props['author_name'] = ("spoob", "RaNaN")
+ props['author_mail'] = ("spoob@pyload.org")
+ self.props = props
+ self.parent = parent
+ self.html = [None, None, None]
+ self.want_reconnect = False
+ self.init_ocr()
+
+ def prepare(self, thread):
+ pyfile = self.parent
+
+ self.want_reconnect = False
+
+ tries = 0
+
+ while not pyfile.status.url:
+
+ self.req.clear_cookies()
+ self.download_html()
+
+ pyfile.status.exists = self.file_exists()
+
+ if not pyfile.status.exists:
+ raise Exception, "The file was not found on the server."
+
+ pyfile.status.filename = self.get_file_name()
+
+ self.download_html2()
+
+ self.get_wait_time()
+
+ pyfile.status.waituntil = self.time_plus_wait
+ pyfile.status.want_reconnect = self.want_reconnect
+
+ thread.wait(self.parent)
+
+ pyfile.status.url = self.get_file_url()
+
+ tries += 1
+ if tries > 3:
+ raise Exception, "Error while preparing DL, HTML dump: %s %s" % (self.html[0], self.html[1])
+
+ return True
+
+
+ def download_html(self):
+ url = self.parent.url
+ self.html[0] = self.req.load(url, cookies=True)
+
+ def download_html2(self):
+
+ url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "")
+
+ for i in range(6):
+ self.html[1] = self.req.load(url_captcha_html, cookies=True)
+
+ try:
+ captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1)
+ except:
+ url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[1]).group(1).replace("amp;", "")
+ self.html[1] = self.req.load(url_captcha_html, cookies=True)
+ captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1)
+
+ file_id = re.search('', self.html[1]).group(1)
+
+ captcha_image = tempfile.NamedTemporaryFile(suffix=".png").name
+
+ self.req.download(captcha_url, captcha_image, cookies=True)
+ captcha = self.ocr.get_captcha(captcha_image)
+ self.logger.debug("Captcha %s: %s" % (i, captcha))
+ sleep(5)
+ self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True)
+
+ os.remove(captcha_image)
+
+ if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None:
+ return True
+
+ raise Exception, "Captcha reading failed"
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ try:
+ file_url_pattern = r"Click here"
+ search = re.search(file_url_pattern, self.html[2])
+ return search.group(1)
+ except:
+ return None
+
+ def get_wait_time(self):
+ wait = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1))
+ self.time_plus_wait = time() + wait / 100
+
+ if re.search(r"We had a reqeust with the IP", self.html[2]):
+ self.want_reconnect = True
+
+ def get_file_name(self):
+ try:
+ file_name_pattern = '\t\t\t(.+)'
+ return re.search(file_name_pattern, self.html[0]).group(1)
+ except:
+ return self.parent.url
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if re.search(r"The file has been deleted", self.html[0]) != None:
+ return False
+ else:
+ return True
+
+ def proceed(self, url, location):
+
+ self.req.download(url, location, cookies=True)
diff --git a/module/plugins/OneKhDe.py b/module/plugins/OneKhDe.py
new file mode 100644
index 000000000..15c3a6872
--- /dev/null
+++ b/module/plugins/OneKhDe.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.unescape import unescape
+from Plugin import Plugin
+
+class OneKhDe(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "OneKhDe"
+ props['type'] = "container"
+ props['pattern'] = r"http://(www\.)?1kh.de/f/"
+ props['version'] = "0.1"
+ props['description'] = """1kh.de 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)
+ temp_links = []
+ link_ids = re.findall(r"", self.req.load("http://1kh.de/l/" + id)).group(1))
+ temp_links.append(new_link)
+ self.links = temp_links
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
new file mode 100644
index 000000000..5b3c7ee8c
--- /dev/null
+++ b/module/plugins/Plugin.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+#Copyright (C) 2009 kingzero, RaNaN
+#
+#This program is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation; either version 3 of the License,
+#or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#See the GNU General Public License for more details.
+#
+#You should have received a copy of the GNU General Public License
+# along with this program; if not, see
.+/(.+) ", self.req.load("http://relink.us/f/%s/1/%i" % (container_id, number))).group(1)
+ temp_links.append(new_link)
+ print temp_links
+ self.links = temp_links
diff --git a/module/plugins/ShareonlineBiz.py b/module/plugins/ShareonlineBiz.py
new file mode 100644
index 000000000..d42ef9302
--- /dev/null
+++ b/module/plugins/ShareonlineBiz.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import os
+import re
+import tempfile
+from time import time
+from base64 import b64decode
+
+from Plugin import Plugin
+
+class ShareonlineBiz(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "ShareonlineBiz"
+ props['type'] = "hoster"
+ props['pattern'] = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id="
+ props['version'] = "0.1"
+ props['description'] = """Shareonline.biz Download Plugin"""
+ props['author_name'] = ("spoob")
+ props['author_mail'] = ("spoob@pyload.org")
+ self.props = props
+ self.parent = parent
+ self.html = [None, None]
+ self.want_reconnect = False
+ self.init_ocr()
+ self.multi_dl = False
+
+ def download_html(self):
+ url = self.parent.url
+ self.html[0] = self.req.load(url, cookies=True)
+
+ captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name
+
+ for i in range(5):
+ self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True)
+ captcha = self.ocr.get_captcha(captcha_image)
+ self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True)
+ if re.search(r"Der Download ist Ihnen zu langsam?", self.html[1]) != None:
+ self.time_plus_wait = time() + 15
+ break
+
+ os.remove(captcha_image)
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ if self.html[0] == None:
+ self.download_html()
+ if not self.want_reconnect:
+ file_url_pattern = 'loadfilelink\.decode\("(.*==)"\);'
+ return b64decode(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()
+ if not self.want_reconnect:
+ file_name_pattern = 'class="locatedActive">Download (.*)'
+ return re.search(file_name_pattern, self.html[1]).group(1)
+ else:
+ return self.parent.url
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html[0] == None:
+ self.download_html()
+ if re.search(r"nicht zum Download bereitgestellt werden", self.html[0]) != None:
+ return False
+ else:
+ return True
diff --git a/module/plugins/ShragleCom.py b/module/plugins/ShragleCom.py
new file mode 100644
index 000000000..bcf650d69
--- /dev/null
+++ b/module/plugins/ShragleCom.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import time
+
+from Plugin import Plugin
+
+class ShragleCom(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "ShragleCom"
+ props['type'] = "hoster"
+ props['pattern'] = r"http://(?:www.)?shragle.com/files/"
+ props['version'] = "0.1"
+ props['description'] = """Shragle Download PLugin"""
+ props['author_name'] = ("RaNaN")
+ props['author_mail'] = ("RaNaN@pyload.org")
+ self.props = props
+ self.parent = parent
+ self.html = None
+ self.multi_dl = False
+
+ def set_parent_status(self):
+ """ sets all available Statusinfos about a File in self.parent.status
+ """
+ if self.html == None:
+ self.download_html()
+ 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)
+ self.time_plus_wait = time.time() + 10
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ if self.html == None:
+ self.download_html()
+
+ self.fileID = re.search(r"name=\"fileID\" value=\"([^\"]+)", self.html).group(1)
+ self.dlSession = re.search(r"name=\"dlSession\" value=\"([^\"]+)", self.html).group(1)
+ self.userID = ""
+ self.password = ""
+ self.lang = "de"
+ return "http://srv4.shragle.com/download.php"
+
+ def get_file_name(self):
+ if self.html == None:
+ self.download_html()
+
+ file_name_pattern = r"<\/div>(.+)<\/h2"
+ return re.search(file_name_pattern, self.html).group(1)
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html == None:
+ self.download_html()
+
+ if re.search(r"html", self.html) == None:
+ return False
+ else:
+ return True
+
+ def proceed(self, url, location):
+ self.req.download(url, location, {'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang})
\ No newline at end of file
diff --git a/module/plugins/StealthTo.py b/module/plugins/StealthTo.py
new file mode 100644
index 000000000..c904a07c3
--- /dev/null
+++ b/module/plugins/StealthTo.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+
+from Plugin import Plugin
+
+class StealthTo(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "StealthTo"
+ props['type'] = "container"
+ props['pattern'] = r"http://(www\.)?stealth.to/folder/"
+ props['version'] = "0.1"
+ props['description'] = """Stealth.to 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, cookies=True)
+ temp_links = []
+ ids = []
+ ats = [] # authenticity_token
+ inputs = re.findall(r"(<(input|form)[^>]+)", self.html)
+ for input in inputs:
+ if re.search(r"name=\"authenticity_token\"",input[0]):
+ ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1))
+ if re.search(r"name=\"id\"",input[0]):
+ ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1))
+
+ for i in range(0, len(ids)):
+ self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True)
+ new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, cookies=True)
+ temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1))
+
+ self.links = temp_links
diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py
new file mode 100644
index 000000000..e65be789c
--- /dev/null
+++ b/module/plugins/UploadedTo.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from time import time
+from Plugin import Plugin
+
+class UploadedTo(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "UploadedTo"
+ props['type'] = "hoster"
+ props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/"
+ props['version'] = "0.1"
+ props['description'] = """Uploaded.to Download Plugin"""
+ props['author_name'] = ("spoob")
+ props['author_mail'] = ("spoob@pyload.org")
+ self.props = props
+ 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.want_reconnect = None
+ self.multi_dl = False
+
+ def prepare(self, thread):
+ pyfile = self.parent
+
+ self.want_reconnect = False
+ tries = 0
+
+ while not pyfile.status.url:
+
+ self.download_html()
+
+ pyfile.status.exists = self.file_exists()
+
+ if not pyfile.status.exists:
+ raise Exception, "The file was not found on the server."
+
+ pyfile.status.filename = self.get_file_name()
+
+ pyfile.status.waituntil = self.time_plus_wait
+ pyfile.status.url = self.get_file_url()
+ pyfile.status.want_reconnect = self.want_reconnect
+
+ thread.wait(self.parent)
+
+ pyfile.status.filename = self.get_file_name()
+
+ tries += 1
+ if tries > 5:
+ raise Exception, "Error while preparing DL, HTML dump: %s" % self.html
+
+ return True
+
+ def download_html(self):
+ url = self.parent.url
+ self.html = self.req.load(url)
+
+ try:
+ wait_minutes = re.search(r"Or wait ([\d\-]+) minutes", self.html).group(1)
+ if int(wait_minutes) < 0: wait_minutes = 1
+ self.time_plus_wait = time() + 60 * int(wait_minutes)
+ self.want_reconnect = True
+ except:
+ self.time_plus_wait = 0
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ try:
+ file_url_pattern = r".*
\s+(.+)\s", self.html).group(1)
+ file_suffix = re.search(r" (\..+) ", self.html)
+ if not file_suffix:
+ return file_name
+ return file_name + file_suffix.group(1)
+ except:
+ self.parent.status.url = None
+ return self.parent.url
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if re.search(r"(File doesn't exist .*)", self.html) != None:
+ return False
+ else:
+ return True
diff --git a/module/plugins/XupIn.py b/module/plugins/XupIn.py
new file mode 100644
index 000000000..6b1f3be73
--- /dev/null
+++ b/module/plugins/XupIn.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from Plugin import Plugin
+
+class XupIn(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "XupIn"
+ props['type'] = "hoster"
+ props['pattern'] = r"http://(?:www.)?xup.in/"
+ props['version'] = "0.1"
+ props['description'] = """Xup.in Download Plugin"""
+ props['author_name'] = ("spoob")
+ props['author_mail'] = ("spoob@pyload.org")
+ self.props = props
+ 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.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:
+ file_url_pattern = r".*
", self.html).group(1)
+ return file_name
+ else:
+ return self.parent.url
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html == None:
+ self.download_html()
+ if re.search(r"HTTP Status 404", self.html) != None:
+ return False
+ else:
+ return True
+
+ def proceed(self, url, location):
+
+ self.req.download(url, location, cookies=True)
diff --git a/module/plugins/ZshareNet.py b/module/plugins/ZshareNet.py
new file mode 100644
index 000000000..33667605f
--- /dev/null
+++ b/module/plugins/ZshareNet.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+from Plugin import Plugin
+
+class ZshareNet(Plugin):
+
+ def __init__(self, parent):
+ Plugin.__init__(self, parent)
+ props = {}
+ props['name'] = "ZshareNet"
+ props['type'] = "hoster"
+ props['pattern'] = r"http://(?:www.)?zshare.net/"
+ props['version'] = "0.1"
+ props['description'] = """Zshare.net Download Plugin"""
+ props['author_name'] = ("spoob")
+ props['author_mail'] = ("spoob@pyload.org")
+ self.props = props
+ self.parent = parent
+ self.html = [None, None]
+ self.html_old = None #time() where loaded the HTML
+ self.time_plus_wait = None #time() + wait in seconds
+ self.posts = {}
+ self.want_reconnect = False
+ self.multi_dl = False
+
+ def download_html(self):
+ url = self.parent.url
+ self.html[0] = self.req.load(url)
+ if "/video/" in url:
+ url = url.replace("/video/", "/download/")
+ elif "/audio/" in url:
+ url = url.replace("/audio/", "/download/")
+ elif "/image/" in url:
+ url = url.replace("/image/", "/download/")
+ self.html[1] = self.req.load(url, None, {"download": "1"})
+
+ def get_file_url(self):
+ """ returns the absolute downloadable filepath
+ """
+ if self.html[0] == None:
+ self.download_html()
+ if not self.want_reconnect:
+ file_url = "".join(eval(re.search("var link_enc=new Array(.*);link", self.html[1]).group(1)))
+ return file_url
+ else:
+ return False
+
+ def get_file_name(self):
+ if self.html[0] == None:
+ self.download_html()
+ if not self.want_reconnect:
+ file_name = re.search("(.*)", self.html[0]).group(1)
+ return file_name
+ else:
+ return self.parent.url
+
+ def file_exists(self):
+ """ returns True or False
+ """
+ if self.html[0] == None:
+ self.download_html()
+ if re.search(r"File Not Found", self.html[0]) != None:
+ return False
+ else:
+ return True
+
+ def wait_until(self):
+ if self.html[0] == None:
+ self.download_html()
+ return self.time_plus_wait
diff --git a/module/plugins/__init__.py b/module/plugins/__init__.py
new file mode 100644
index 000000000..8d1c8b69c
--- /dev/null
+++ b/module/plugins/__init__.py
@@ -0,0 +1 @@
+
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 801eee9c6..c0d0bccce 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -47,7 +47,7 @@ class Core(object):
"""
def __init__(self):
self.config = {}
- self.config['plugin_folder'] = "plugins"
+ self.plugin_folder = "module" + sep + "plugins"
self.plugins_avaible = {}
self.read_config()
@@ -73,7 +73,7 @@ class Core(object):
self.logger.info(_("Downloadtime: %s") % self.is_dltime()) # debug only
- path.append(self.config['plugin_folder'])
+ path.append(self.plugin_folder)
self.create_plugin_index()
self.init_server()
@@ -106,9 +106,8 @@ class Core(object):
return self.config
def create_plugin_index(self):
- plugin_folder = self.config['plugin_folder']
- for file_handler in glob(plugin_folder + sep + '*.py') + glob(plugin_folder + sep + 'DLC.pyc'):
- if file_handler != plugin_folder + sep + "Plugin.py":
+ for file_handler in glob(self.plugin_folder + sep + '*.py') + glob(self.plugin_folder + sep + 'DLC.pyc'):
+ if file_handler != self.plugin_folder + sep + "Plugin.py":
plugin_pattern = ""
plugin_file = basename(file_handler).replace('.pyc', '').replace('.py', '')
for line in open(file_handler, "r").readlines():
--
cgit v1.2.3