From b879a5e72b28484060a2788713897b4337701027 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 2 Oct 2011 14:24:35 +0200 Subject: purged old plugins --- module/plugins/hoster/ArchivTo.py | 46 ---------- module/plugins/hoster/KickloadCom.py | 96 +++++++++++++++++++ module/plugins/hoster/ShareCx.py | 173 ----------------------------------- module/plugins/hoster/StorageTo.py | 97 -------------------- 4 files changed, 96 insertions(+), 316 deletions(-) delete mode 100644 module/plugins/hoster/ArchivTo.py create mode 100644 module/plugins/hoster/KickloadCom.py delete mode 100644 module/plugins/hoster/ShareCx.py delete mode 100644 module/plugins/hoster/StorageTo.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ArchivTo.py b/module/plugins/hoster/ArchivTo.py deleted file mode 100644 index 02ff207ab..000000000 --- a/module/plugins/hoster/ArchivTo.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster -from module.unescape import unescape - -class ArchivTo(Hoster): - __name__ = "ArchivTo" - __type__ = "hoster" - __pattern__ = r"http://(www\.)?archiv.to/view/divx/" - __version__ = "0.1" - __description__ = """Archiv.to Video Download Hoster""" - __author_name__ = ("Petersilie") - __author_mail__ = ("None") - - def setup(self): - self.html = None - - def process(self, pyfile): - self.pyfile = pyfile - self.download_html() - pyfile.name = self.get_file_name() - self.download(self.get_file_url()) - - def download_html(self): - # open url (save cookies needed for download) - self.html = self.load(self.pyfile.url, cookies=True) - - def get_file_url(self): - # get actual file url for downloading - file_url = re.search(r"autoplay=\"true\" custommode=\"none\" src=\"(http://.*?)\"", self.html).group(1) - return file_url - - def get_file_name(self): - file_name = re.search(r"style=\"color:black;text-decoration:none;font-size:14px;font-weight:bold\">(.*?)", self.html) - if not file_name: - file_name = re.search(r"movietitle=\"(.*?)\"", self.html) - return unescape(file_name.group(1)) - - def file_exists(self): - # check if file still exists - self.download_html() - self.load(str(self.pyfile.url), cookies=False) - if self.get_file_name(): - return True - return False diff --git a/module/plugins/hoster/KickloadCom.py b/module/plugins/hoster/KickloadCom.py new file mode 100644 index 000000000..9f1e5083d --- /dev/null +++ b/module/plugins/hoster/KickloadCom.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.plugins.Hoster import Hoster + +class KickloadCom(Hoster): + __name__ = "KickloadCom" + __type__ = "hoster" + __pattern__ = r"http://(?:www)?\.?(?:storage\.to|kickload\.com)/get/.*" + __version__ = "0.2" + __description__ = """Storage.to / Kickload.com Download Hoster""" + __author_name__ = ("mkaay") + + def setup(self): + self.wantReconnect = False + self.api_data = None + self.html = None + self.multiDL = False + + def process(self, pyfile): + self.pyfile = pyfile + self.prepare() + self.download( self.get_file_url() ) + + def prepare(self): + pyfile = self.pyfile + + self.wantReconnect = False + + if not self.file_exists(): + self.offline() + + pyfile.name = self.get_file_name() + + self.setWait( self.get_wait_time() ) + + while self.wantReconnect: + self.wait() + self.download_api_data() + self.setWait( self.get_wait_time() ) + + return True + + def download_html(self): + url = self.pyfile.url + self.html = self.load(url) + + def download_api_data(self): + url = self.pyfile.url + info_url = url.replace("/get/", "/getlink/") + src = self.load(info_url) + if "To download this file you need a premium account" in src: + self.fail("Need premium account for this file") + + pattern = re.compile(r"'(\w+)' : (.*?)[,|\}]") + self.api_data = {} + for pair in pattern.findall(src): + self.api_data[pair[0]] = pair[1].strip("'") + print self.api_data + + def get_wait_time(self): + if not self.api_data: + self.download_api_data() + if self.api_data["state"] == "wait": + self.wantReconnect = True + else: + self.wantReconnect = False + + return int(self.api_data["countdown"]) + 3 + + + + def file_exists(self): + """ returns True or False + """ + if not self.api_data: + self.download_api_data() + if self.api_data["state"] == "failed": + return False + else: + return True + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if not self.api_data: + self.download_api_data() + return self.api_data["link"] + + def get_file_name(self): + if not self.html: + self.download_html() + file_name_pattern = r"Downloading:(.*?)(.*?)" + return re.search(file_name_pattern, self.html).group(1).strip() diff --git a/module/plugins/hoster/ShareCx.py b/module/plugins/hoster/ShareCx.py deleted file mode 100644 index cd3c4109b..000000000 --- a/module/plugins/hoster/ShareCx.py +++ /dev/null @@ -1,173 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster -from module.plugins.Plugin import chunks -from module.network.RequestFactory import getURL -#from module.BeautifulSoup import BeautifulSoup - -def getInfo(urls): - api_url = "http://www.share.cx/uapi?do=check&links=" - - for chunk in chunks(urls, 90): - get = "" - for url in chunk: - get += ";"+url - - api = getURL(api_url+get[1:]) - result = [] - - for i, link in enumerate(api.split()): - url,name,size = link.split(";") - if name and size: - status = 2 - else: - status = 1 - - if not name: name = chunk[i] - if not size: size = 0 - - result.append( (name, size, status, chunk[i]) ) - - yield result - -class ShareCx(Hoster): - __name__ = "ShareCx" - __type__ = "hoster" - __pattern__ = r"http://[\w\.]*?share\.cx/(files|videos)/\d+" - __version__ = "0.31" - __description__ = """Share.cx Download Hoster""" - __author_name__ = ("jeix") - __author_mail__ = ("jeix@hasnomail.de") - - - def init(self): - if self.account: - self.multiDL = True - else: - self.multiDL = False - - - def process(self, pyfile): - - self.fail("Hoster is gone offline forever.") - - self.pyfile = pyfile - self.download_html() - if not self.file_exists(): - self.offline() - - pyfile.name = self.get_file_name() - if self.account: - self.handlePremium() - else: - self.handleFree() - - - def download_html(self): - self.html = self.load(self.pyfile.url, cookies=False) - - def handleFree(self): - """ returns the absolute downloadable filepath - """ - if self.html is None: - self.download_html() - - try: - op = re.search(r'name="op" value="(.*?)"', self.html).group(1) - usr_login = re.search(r'name="usr_login" value="(.*?)"', self.html).group(1) - id = re.search(r'name="id" value="(.*?)"', self.html).group(1) - fname = re.search(r'name="fname" value="(.*?)"', self.html).group(1) - referer = re.search(r'name="referer" value="(.*?)"', self.html).group(1) - method_free = "Datei+herunterladen" - - self.html = self.load(self.pyfile.url, post={ - "op" : op, - "usr_login" : usr_login, - "id" : id, - "fname" : fname, - "referer" : referer, - "method_free" : method_free - }) - except: - # looks like we ARE already on page 2 - pass - - m = re.search(r'startTimer\((\d+)\)', self.html) - if m is not None: - wait_time = int(m.group(1)) - self.setWait(wait_time) - self.wantReconnect = True - self.log.debug("%s: IP blocked wait %d seconds." % (self.__name__, wait_time)) - self.wait() - self.retry() - - m = re.search(r'countdown">.*?(\d+).*?', self.html) - if m is None: - m = re.search(r'id="countdown_str".*?.*?(\d+).*?([^/]+)', self.html).group(1) - return name - - def file_exists(self): - """ returns True or False - """ - if self.html is None: - self.download_html() - - if re.search(r'File not found
It was deleted due to inactivity or abuse request', self.html) is not None: - return False - - return True - - def handlePremium(self): - self.download(self.pyfile.url) - diff --git a/module/plugins/hoster/StorageTo.py b/module/plugins/hoster/StorageTo.py deleted file mode 100644 index d3f9bce96..000000000 --- a/module/plugins/hoster/StorageTo.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time - -from module.plugins.Hoster import Hoster - -class StorageTo(Hoster): - __name__ = "StorageTo" - __type__ = "hoster" - __pattern__ = r"http://(?:www)?\.?(?:storage\.to|kickload\.com)/get/.*" - __version__ = "0.2" - __description__ = """Storage.to / Kickload.com Download Hoster""" - __author_name__ = ("mkaay") - - def setup(self): - self.wantReconnect = False - self.api_data = None - self.html = None - self.multiDL = False - - def process(self, pyfile): - self.pyfile = pyfile - self.prepare() - self.download( self.get_file_url() ) - - def prepare(self): - pyfile = self.pyfile - - self.wantReconnect = False - - if not self.file_exists(): - self.offline() - - pyfile.name = self.get_file_name() - - self.setWait( self.get_wait_time() ) - - while self.wantReconnect: - self.wait() - self.download_api_data() - self.setWait( self.get_wait_time() ) - - return True - - def download_html(self): - url = self.pyfile.url - self.html = self.load(url, cookies=True) - - def download_api_data(self): - url = self.pyfile.url - info_url = url.replace("/get/", "/getlink/") - src = self.load(info_url, cookies=True) - if "To download this file you need a premium account" in src: - self.fail("Need premium account for this file") - - pattern = re.compile(r"'(\w+)' : (.*?)[,|\}]") - self.api_data = {} - for pair in pattern.findall(src): - self.api_data[pair[0]] = pair[1].strip("'") - print self.api_data - - def get_wait_time(self): - if not self.api_data: - self.download_api_data() - if self.api_data["state"] == "wait": - self.wantReconnect = True - else: - self.wantReconnect = False - - return int(self.api_data["countdown"]) + 3 - - - - def file_exists(self): - """ returns True or False - """ - if not self.api_data: - self.download_api_data() - if self.api_data["state"] == "failed": - return False - else: - return True - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if not self.api_data: - self.download_api_data() - return self.api_data["link"] - - def get_file_name(self): - if not self.html: - self.download_html() - file_name_pattern = r"Downloading:(.*?)(.*?)" - return re.search(file_name_pattern, self.html).group(1).strip() -- cgit v1.2.3