summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-02 14:24:35 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-02 14:24:35 +0200
commitb879a5e72b28484060a2788713897b4337701027 (patch)
tree5d6ec91766f4890fffb56d142615429db371dcce
parentroyflos GUI patch 2 (diff)
downloadpyload-b879a5e72b28484060a2788713897b4337701027.tar.xz
purged old plugins
-rw-r--r--module/plugins/accounts/ShareCx.py47
-rw-r--r--module/plugins/hoster/ArchivTo.py46
-rw-r--r--module/plugins/hoster/KickloadCom.py (renamed from module/plugins/hoster/StorageTo.py)9
-rw-r--r--module/plugins/hoster/ShareCx.py173
4 files changed, 4 insertions, 271 deletions
diff --git a/module/plugins/accounts/ShareCx.py b/module/plugins/accounts/ShareCx.py
deleted file mode 100644
index c4aac257f..000000000
--- a/module/plugins/accounts/ShareCx.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
- 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 <http://www.gnu.org/licenses/>.
-
- @author: RaNaN
-"""
-
-import re
-from time import strptime, mktime
-
-from module.plugins.Account import Account
-
-class ShareCx(Account):
- __name__ = "ShareCx"
- __version__ = "0.1"
- __type__ = "account"
- __description__ = """share.cx account plugin"""
- __author_name__ = ("RaNaN")
- __author_mail__ = ("RaNaN@pyload.org")
-
- def loadAccountInfo(self, user, req):
- page = req.load("http://www.share.cx/myaccount")
-
- valid = re.search("<TR><TD>Valid till</TD><TD>([0-9\.]+)</TD></TR>", page, re.IGNORECASE).group(1)
- valid = int(mktime(strptime(valid, "%d.%m.%Y")))
-
- return {"trafficleft": -1, "validuntil" : valid}
-
-
- def login(self, user, data,req):
- req.cj.setCookie("share.cx", "lang", "english")
- page = req.load("http://www.share.cx", None, { "redirect" : "http://www.share.cx/", "login": user, "password" : data['password'], "op" : "login"})
-
- if "Incorrect Login or Password" in page:
- self.wrongPassword() \ No newline at end of file
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\">(.*?)</a>", 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/StorageTo.py b/module/plugins/hoster/KickloadCom.py
index d3f9bce96..9f1e5083d 100644
--- a/module/plugins/hoster/StorageTo.py
+++ b/module/plugins/hoster/KickloadCom.py
@@ -2,12 +2,11 @@
# -*- coding: utf-8 -*-
import re
-from time import time
from module.plugins.Hoster import Hoster
-class StorageTo(Hoster):
- __name__ = "StorageTo"
+class KickloadCom(Hoster):
+ __name__ = "KickloadCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www)?\.?(?:storage\.to|kickload\.com)/get/.*"
__version__ = "0.2"
@@ -46,12 +45,12 @@ class StorageTo(Hoster):
def download_html(self):
url = self.pyfile.url
- self.html = self.load(url, cookies=True)
+ 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, cookies=True)
+ 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")
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+).*?</span>', self.html)
- if m is None:
- m = re.search(r'id="countdown_str".*?<span id=".*?">.*?(\d+).*?</span', self.html)
- if m is not None:
- wait_time = int(m.group(1))
- self.setWait(wait_time)
- self.wantReconnect = False
- self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait_time))
- self.wait()
-
-
- op = re.search(r'name="op" value="(.*?)"', self.html).group(1)
- id = re.search(r'name="id" value="(.*?)"', self.html).group(1)
- rand = re.search(r'name="rand" value="(.*?)"', self.html).group(1)
- referer = re.search(r'name="referer" value="(.*?)"', self.html).group(1)
- method_free = re.search(r'name="method_free" value="(.*?)"', self.html).group(1)
- method_premium = re.search(r'name="method_premium" value="(.*?)"', self.html).group(1)
- down_script = re.search(r'name="down_script" value="(.*?)"', self.html)
-
- data = {
- "op" : op,
- "id" : id,
- "rand" : rand,
- "referer" : referer,
- "method_free" : method_free,
- "method_premium" : method_premium,
- #"down_script" : down_script
- }
-
- if down_script:
- data["down_script"] = down_script.group(1)
-
- if '/captchas/' in self.html:
- captcha_url = re.search(r'(http://(?:[\w\d]+\.)?.*?/captchas/.*?)', self.html).group(1)
- captcha = self.decryptCaptcha(captcha_url)
- data["code"] = captcha
-
-
- self.download(self.pyfile.url, post=data)
-
- # soup = BeautifulSoup(html)
- # form = soup.find("form")
- # postfields = {}
- # for input in form,findall("input"):
- # postfields[input["name"]] = input["value"]
- # postfields["method_free"] = "Datei herunterladen"
-
- def get_file_name(self):
- if self.html is None:
- self.download_html()
-
- name = re.search(r'/></span>([^/]+)</h3>', 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<br>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)
-