summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-10-12 23:53:45 +0200
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-10-12 23:53:45 +0200
commitde034056468bb5cea26351be1d76f01fd2826395 (patch)
tree7b8ce13d742c1eeb6cb81e3fcfe43a55ed50a53e
parentbetter updatemanager (diff)
downloadpyload-de034056468bb5cea26351be1d76f01fd2826395.tar.xz
Cleanup.
-rw-r--r--module/plugins/accounts/CoolshareCz.py71
-rw-r--r--module/plugins/accounts/FilesonicCom.py70
-rw-r--r--module/plugins/accounts/MegauploadCom.py53
-rwxr-xr-xmodule/plugins/accounts/OronCom.py54
-rw-r--r--module/plugins/hoster/CoolshareCz.py61
-rw-r--r--module/plugins/hoster/EnteruploadCom.py82
-rw-r--r--module/plugins/hoster/FiledinoCom.py21
-rw-r--r--module/plugins/hoster/FilesonicCom.py217
-rw-r--r--module/plugins/hoster/KickloadCom.py96
-rw-r--r--module/plugins/hoster/MegauploadCom.py175
-rw-r--r--module/plugins/hoster/MegavideoCom.py118
-rw-r--r--module/plugins/hoster/NahrajCz.py54
-rwxr-xr-xmodule/plugins/hoster/OronCom.py147
-rw-r--r--module/plugins/hoster/PrzeklejPl.py47
-rw-r--r--module/plugins/hoster/StahnuTo.py63
-rw-r--r--module/plugins/hoster/UploadboxCom.py95
-rw-r--r--module/plugins/hoster/UploadhereCom.py34
-rw-r--r--module/plugins/hoster/UploadkingCom.py44
-rw-r--r--module/plugins/hoster/ZShareNet.py70
19 files changed, 0 insertions, 1572 deletions
diff --git a/module/plugins/accounts/CoolshareCz.py b/module/plugins/accounts/CoolshareCz.py
deleted file mode 100644
index 03686c729..000000000
--- a/module/plugins/accounts/CoolshareCz.py
+++ /dev/null
@@ -1,71 +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: zoidberg
-"""
-
-#shares code with WarserverCz
-
-from module.plugins.Account import Account
-import re
-from time import mktime, strptime
-
-class CoolshareCz(Account):
- __name__ = "CoolshareCz"
- __version__ = "0.01"
- __type__ = "account"
- __description__ = """CoolShare.cz account plugin"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- VALID_UNTIL_PATTERN = ur'<li>Neomezené stahování do: <strong>(.+?)<'
- TRAFFIC_LEFT_PATTERN = ur'<li>Kredit: <strong>.*?\(\s*(.+?)\s*B\)'
-
- DOMAIN = "http://www.coolshare.cz"
-
- def loadAccountInfo(self, user, req):
- html = req.load("%s/uzivatele/prehled" % self.DOMAIN, decode = True)
-
- validuntil = trafficleft = None
- premium = False
-
- found = re.search(self.VALID_UNTIL_PATTERN, html)
- if found:
- self.logDebug("VALID_UNTIL", found.group(1))
- try:
- #validuntil = mktime(strptime(found.group(1), "%d %B %Y"))
- premium = True
- trafficleft = -1
- except Exception, e:
- self.logError(e)
-
- found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if found:
- self.logDebug("TRAFFIC_LEFT", found.group(1))
- trafficleft = int(found.group(1).replace("&thinsp;","")) // 1024
- premium = True if trafficleft > 1 << 18 else False
-
- return ({"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium})
-
- def login(self, user, data, req):
- html = req.load('%s/uzivatele/prihlaseni?do=prihlaseni-submit' % self.DOMAIN,
- post = {"username": user,
- "password": data['password'],
- "send": u"Přihlásit"},
- decode = True)
-
- if '<p class="chyba">' in html:
- self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/accounts/FilesonicCom.py b/module/plugins/accounts/FilesonicCom.py
deleted file mode 100644
index 1207f1b56..000000000
--- a/module/plugins/accounts/FilesonicCom.py
+++ /dev/null
@@ -1,70 +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
-"""
-
-from time import mktime, strptime
-
-from module.plugins.Account import Account
-from module.common.json_layer import json_loads
-
-class FilesonicCom(Account):
- __name__ = "FilesonicCom"
- __version__ = "0.31"
- __type__ = "account"
- __description__ = """filesonic.com account plugin"""
- __author_name__ = ("RaNaN", "Paul King")
- __author_mail__ = ("RaNaN@pyload.org", "")
-
- API_URL = "http://api.filesonic.com"
-
- def getDomain(self, req):
- xml = req.load(self.API_URL + "/utility?method=getFilesonicDomainForCurrentIp&format=json",
- decode=True)
- return json_loads(xml)["FSApi_Utility"]["getFilesonicDomainForCurrentIp"]["response"]
-
- def loadAccountInfo(self, user, req):
- xml = req.load(self.API_URL + "/user?method=getInfo&format=json",
- post={"u": user,
- "p": self.accounts[user]["password"]}, decode=True)
-
- self.logDebug("account status retrieved from api %s" % xml)
-
- json = json_loads(xml)
- if json["FSApi_User"]["getInfo"]["status"] != "success":
- self.logError(_("Invalid login retrieving user details"))
- return {"validuntil": -1, "trafficleft": -1, "premium": False}
- premium = json["FSApi_User"]["getInfo"]["response"]["users"]["user"]["is_premium"]
- if premium:
- validuntil = json["FSApi_User"]["getInfo"]["response"]["users"]["user"]["premium_expiration"]
- validuntil = int(mktime(strptime(validuntil, "%Y-%m-%d %H:%M:%S")))
- else:
- validuntil = -1
- return {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
-
- def login(self, user, data, req):
- domain = self.getDomain(req)
-
- post_vars = {
- "email": user,
- "password": data["password"],
- "rememberMe": 1
- }
- page = req.load("http://www%s/user/login" % domain, cookies=True, post=post_vars, decode=True)
-
- if "Provided password does not match." in page or "You must be logged in to view this page." in page:
- self.wrongPassword()
diff --git a/module/plugins/accounts/MegauploadCom.py b/module/plugins/accounts/MegauploadCom.py
deleted file mode 100644
index ff4f5971c..000000000
--- a/module/plugins/accounts/MegauploadCom.py
+++ /dev/null
@@ -1,53 +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: mkaay
-"""
-
-import re
-from time import time
-
-from module.plugins.Account import Account
-
-class MegauploadCom(Account):
- __name__ = "MegauploadCom"
- __version__ = "0.12"
- __type__ = "account"
- __description__ = """megaupload account plugin"""
- __author_name__ = ("RaNaN")
- __author_mail__ = ("RaNaN@pyload.org")
-
- def loadAccountInfo(self, user, req):
- page = req.load("http://www.megaupload.com/?c=account&setlang=en", decode = True)
-
- premium = False if r'<div class="account_txt">Regular' in page else True
- validuntil = -1
-
- if premium:
- found = re.search(r'class="account_txt">\s*(\d+)\s*(days|hours|minutes) remaining', page)
- if found:
- validuntil = time() + 60 * int(found.group(1)) * {"days": 1440, "hours": 60, "minutes": 1}[found.group(2)]
-
- if '<div class="account_txt" id="ddltxt"> Deactivated </div>' in page:
- self.core.log.warning(_("Activate direct Download in your MegaUpload Account"))
-
- return {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
-
-
- def login(self, user, data, req):
- page = req.load("http://www.megaupload.com/?c=login&next=c%3Dpremium", post={ "username" : user, "password" : data["password"], "login" :"1"}, cookies=True)
- if "Username and password do not match" in page:
- self.wrongPassword()
diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py
deleted file mode 100755
index 793984121..000000000
--- a/module/plugins/accounts/OronCom.py
+++ /dev/null
@@ -1,54 +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: DHMH
-"""
-
-from module.plugins.Account import Account
-import re
-from time import strptime, mktime
-
-class OronCom(Account):
- __name__ = "OronCom"
- __version__ = "0.12"
- __type__ = "account"
- __description__ = """oron.com account plugin"""
- __author_name__ = ("DHMH")
- __author_mail__ = ("DHMH@pyload.org")
-
- def loadAccountInfo(self, user, req):
- req.load("http://oron.com/?op=change_lang&lang=german")
- src = req.load("http://oron.com/?op=my_account").replace("\n", "")
- validuntil = re.search(r"<td>Premiumaccount läuft bis:</td>\s*<td>(.*?)</td>", src)
- if validuntil:
- validuntil = validuntil.group(1)
- validuntil = int(mktime(strptime(validuntil, "%d %B %Y")))
- trafficleft = re.search(r'<td>Download Traffic verfügbar:</td>\s*<td>(.*?)</td>', src).group(1)
- self.logDebug("Oron left: " + trafficleft)
- trafficleft = int(self.parseTraffic(trafficleft))
- premium = True
- else:
- validuntil = -1
- trafficleft = None
- premium = False
- tmp = {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium}
- return tmp
-
- def login(self, user, data, req):
- req.load("http://oron.com/?op=change_lang&lang=german")
- page = req.load("http://oron.com/login", post={"login": user, "password": data["password"], "op": "login"})
- if r'<b class="err">Login oder Passwort falsch</b>' in page:
- self.wrongPassword()
diff --git a/module/plugins/hoster/CoolshareCz.py b/module/plugins/hoster/CoolshareCz.py
deleted file mode 100644
index 7007b6fcb..000000000
--- a/module/plugins/hoster/CoolshareCz.py
+++ /dev/null
@@ -1,61 +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: zoidberg
-"""
-
-#shares code with WarserverCz
-
-import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.HTTPRequest import BadHeader
-from module.utils import html_unescape
-
-class CoolshareCz(SimpleHoster):
- __name__ = "CoolshareCz"
- __type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)?coolshare.cz/stahnout/(?P<ID>\d+)/.+"
- __version__ = "0.12"
- __description__ = """CoolShare.cz"""
- __author_name__ = ("zoidberg")
-
- FILE_NAME_PATTERN = ur'<h1.*?>Stáhnout (?P<N>[^<]+)</h1>'
- FILE_SIZE_PATTERN = r'<li>Velikost: <strong>(?P<S>[^<]+)</strong>'
- FILE_OFFLINE_PATTERN = r'<h1>Soubor nenalezen</h1>'
-
- PREMIUM_URL_PATTERN = r'href="(http://[^/]+/dwn-premium.php.*?)"'
- DOMAIN = "http://csd01.coolshare.cz"
-
- SH_CHECK_TRAFFIC = True
-
- def handleFree(self):
- try:
- self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID']))
- except BadHeader, e:
- if e.code == 403:
- self.setWait(300, True)
- self.wait()
- self.retry(max_tries = 24, reason = "Download limit reached")
- else: raise
-
- def handlePremium(self):
- found = re.search(self.PREMIUM_URL_PATTERN, self.html)
- if not found: self.parseError("Premium URL")
- url = html_unescape(found.group(1))
- self.logDebug("Premium URL: " + url)
- if not url.startswith("http://"): self.resetAccount()
- self.download(url)
-
-getInfo = create_getInfo(CoolshareCz) \ No newline at end of file
diff --git a/module/plugins/hoster/EnteruploadCom.py b/module/plugins/hoster/EnteruploadCom.py
deleted file mode 100644
index 2c99b0047..000000000
--- a/module/plugins/hoster/EnteruploadCom.py
+++ /dev/null
@@ -1,82 +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: zoidberg
-"""
-
-import re
-from module.plugins.internal.DeadHoster import DeadHoster as SimpleHoster, create_getInfo
-
-class EnteruploadCom(SimpleHoster):
- __name__ = "EnteruploadCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?enterupload.com/\w+.*"
- __version__ = "0.02"
- __description__ = """EnterUpload.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_INFO_PATTERN = r'<h3>(?P<N>[^<]+)</h3>\s*<span>File size:\s*(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?B</span>'
- FILE_OFFLINE_PATTERN = r'<(b|h2)>File Not Found</(b|h2)>|<font class="err">No such file with this filename</font>'
- TEMP_OFFLINE_PATTERN = r'>This server is in maintenance mode\. Refresh this page in some minutes\.<'
- URL_REPLACEMENTS = [(r"(http://(?:www\.)?enterupload.com/\w+).*", r"\1")]
-
- FORM1_PATTERN = r'<form method="POST" action=\'\' style="display: none;">(.*?)</form>'
- FORM2_PATTERN = r'<form name="F1" method="POST"[^>]*>(.*?)</form>'
- FORM3_PATTERN = r'<form action="([^"]+)" method="get">'
- FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]*)"[^>]*>'
- WAIT_PATTERN = r'<span id="countdown_str">Wait <[^>]*>(\d+)</span> seconds</span>'
-
- def handleFree(self):
- # Page 1
- try:
- form = re.search(self.FORM1_PATTERN, self.html, re.DOTALL).group(1)
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- except Exception, e:
- self.logError(e)
- self.parseError("Form 1")
-
- inputs['method_free'] = 'Free Download'
- self.logDebug(inputs)
- self.html = self.load(self.pyfile.url, post = inputs, decode = True, cookies = True, ref = True)
-
- # Page 2
- try:
- form = re.search(self.FORM2_PATTERN, self.html, re.DOTALL).group(1)
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- except Exception, e:
- self.logError(e)
- self.parseError("Form 2")
-
- inputs['method_free'] = self.pyfile.url
- self.logDebug(inputs)
-
- found = re.search(self.WAIT_PATTERN, self.html)
- if found:
- self.setWait(int(found.group(1)) + 1)
- self.wait()
-
- self.html = self.load(self.pyfile.url, post = inputs, decode = True, cookies = True, ref = True)
-
- # Page 3
- found = re.search(self.FORM3_PATTERN, self.html)
- if not found: self.parseError("Form 3")
- url = found.group(1)
-
- # Download
- self.logDebug("Download URL: " + url)
- self.download(url, cookies = True, ref = True)
-
-getInfo = create_getInfo(EnteruploadCom) \ No newline at end of file
diff --git a/module/plugins/hoster/FiledinoCom.py b/module/plugins/hoster/FiledinoCom.py
deleted file mode 100644
index 6bdd01b51..000000000
--- a/module/plugins/hoster/FiledinoCom.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
-import re
-
-class FiledinoCom(XFileSharingPro):
- __name__ = "FiledinoCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)*(file(dino|fat).com)/\w{12}"
- __version__ = "0.02"
- __description__ = """FileDino / FileFat hoster plugin"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_SIZE_PATTERN = r'File Size : </(span|font)><(span|font)[^>]*>(?P<S>.+?)</(span|font)>'
- DIRECT_LINK_PATTERN = r'http://www\.file(dino|fat)\.com/cgi-bin/dl\.cgi/'
-
- def setup(self):
- self.HOSTER_NAME = re.search(self.__pattern__, self.pyfile.url).group(1)
- self.multiDL = False
-
-getInfo = create_getInfo(FiledinoCom) \ No newline at end of file
diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py
deleted file mode 100644
index 525a99e7a..000000000
--- a/module/plugins/hoster/FilesonicCom.py
+++ /dev/null
@@ -1,217 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-import string
-from urllib import unquote
-
-from module.plugins.Hoster import Hoster
-from module.plugins.ReCaptcha import ReCaptcha
-from module.plugins.Plugin import chunks
-
-from module.network.RequestFactory import getURL
-from module.common.json_layer import json_loads
-
-
-def getInfo(urls):
- yield [(url, 0, 1, url) for url in urls]
-
-
-def getId(url):
- match = re.search(FilesonicCom.FILE_ID_PATTERN, url)
- if match:
- return string.replace(match.group("id"), "/", "-")
- else:
- return None
-
-
-class FilesonicCom(Hoster):
- __name__ = "FilesonicCom"
- __type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/.*?file/([a-zA-Z0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?|[0-9]+(/.+)?)"
- __version__ = "0.36"
- __description__ = """FilesonicCom und Sharingmatrix Download Hoster"""
- __author_name__ = ("jeix", "paulking")
- __author_mail__ = ("jeix@hasnomail.de", "")
-
- API_ADDRESS = "http://api.filesonic.com"
- URL_DOMAIN_PATTERN = r'(?P<prefix>.*?)(?P<domain>.(filesonic|sharingmatrix)\..+?)(?P<suffix>/.*)'
- FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful
- FILE_LINK_PATTERN = r'Your download is ready</p>\s*<a href="(http://[^"]+)'
- WAIT_TIME_PATTERN = r'countDownDelay = (?P<wait>\d+)'
- WAIT_TM_PATTERN = r"name='tm' value='(.*?)' />"
- WAIT_TM_HASH_PATTERN = r"name='tm_hash' value='(.*?)' />"
- CAPTCHA_TYPE1_PATTERN = r'Recaptcha.create\("(.*?)",'
- CAPTCHA_TYPE2_PATTERN = r'id="recaptcha_image"><img style="display: block;" src="(.+)image?c=(.+?)"'
-
- def init(self):
- if self.account:
- self.premium = self.account.getAccountInfo(self.user)["premium"]
- if not self.premium:
- self.chunkLimit = 1
- self.multiDL = False
-
- def process(self, pyfile):
- self.fail("Hoster not longer available")
-
- def checkFile(self, url):
- id = getId(url)
- self.logDebug("file id is %s" % id)
- if id:
- # Use the api to check the current status of the file and fixup data
- check_url = self.API_ADDRESS + "/link?method=getInfo&format=json&ids=%s" % id
- result = json_loads(self.load(check_url, decode=True))
- item = result["FSApi_Link"]["getInfo"]["response"]["links"][0]
- self.logDebug("api check returns %s" % item)
-
- if item["status"] != "AVAILABLE":
- self.offline()
- if item["is_password_protected"] != 0:
- self.fail("This file is password protected")
-
- # ignored this check due to false api information
- #if item["is_premium_only"] != 0 and not self.premium:
- # self.fail("need premium account for file")
-
- self.pyfile.name = unquote(item["filename"])
-
- # Fix the url and resolve the domain to the correct regional variation
- url = item["url"]
- urlparts = re.search(self.URL_DOMAIN_PATTERN, url)
- if urlparts:
- url = urlparts.group("prefix") + self.getDomain() + urlparts.group("suffix")
- self.logDebug("localised url is %s" % url)
- return url
- else:
- self.fail("Invalid URL")
-
- def getDomain(self):
- result = json_loads(
- self.load(self.API_ADDRESS + "/utility?method=getFilesonicDomainForCurrentIp&format=json", decode=True))
- self.logDebug("response to get domain %s" % result)
- return result["FSApi_Utility"]["getFilesonicDomainForCurrentIp"]["response"]
-
-
- def downloadPremium(self):
- self.logDebug("Premium download")
-
- api = self.API_ADDRESS + "/link?method=getDownloadLink&u=%%s&p=%%s&ids=%s" % getId(self.pyfile.url)
-
- result = json_loads(self.load(api % (self.user, self.account.getAccountData(self.user)["password"])))
- links = result["FSApi_Link"]["getDownloadLink"]["response"]["links"]
-
- #wupload seems to return list and no dicts
- if type(links) == dict:
- info = links.values()[0]
- else:
- info = links[0]
-
- if "status" in info and info["status"] == "NOT_AVAILABLE":
- self.tempOffline()
-
- self.download(info["url"])
-
- def downloadFree(self):
- self.logDebug("Free download")
- # Get initial page
- self.html = self.load(self.pyfile.url)
- url = self.pyfile.url + "?start=1"
- self.html = self.load(url)
- self.handleErrors()
-
- finalUrl = re.search(self.FILE_LINK_PATTERN, self.html)
-
- if not finalUrl:
- self.doWait(url)
-
- chall = re.search(self.CAPTCHA_TYPE1_PATTERN, self.html)
- chall2 = re.search(self.CAPTCHA_TYPE2_PATTERN, self.html)
- if chall or chall2:
- for i in range(5):
- re_captcha = ReCaptcha(self)
- if chall:
- self.logDebug("Captcha type1")
- challenge, result = re_captcha.challenge(chall.group(1))
- else:
- self.logDebug("Captcha type2")
- server = chall2.group(1)
- challenge = chall2.group(2)
- result = re_captcha.result(server, challenge)
-
- postData = {"recaptcha_challenge_field": challenge,
- "recaptcha_response_field": result}
-
- self.html = self.load(url, post=postData)
- self.handleErrors()
- chall = re.search(self.CAPTCHA_TYPE1_PATTERN, self.html)
- chall2 = re.search(self.CAPTCHA_TYPE2_PATTERN, self.html)
-
- if chall or chall2:
- self.invalidCaptcha()
- else:
- self.correctCaptcha()
- break
-
- finalUrl = re.search(self.FILE_LINK_PATTERN, self.html)
-
- if not finalUrl:
- self.fail("Couldn't find free download link")
-
- self.logDebug("got download url %s" % finalUrl.group(1))
- self.download(finalUrl.group(1))
-
- def doWait(self, url):
- # If the current page requires us to wait then wait and move to the next page as required
-
- # There maybe more than one wait period. The extended wait if download limits have been exceeded (in which case we try reconnect)
- # and the short wait before every download. Visually these are the same, the difference is that one includes a code to allow
- # progress to the next page
-
- waitSearch = re.search(self.WAIT_TIME_PATTERN, self.html)
- while waitSearch:
- wait = int(waitSearch.group("wait"))
- if wait > 300:
- self.wantReconnect = True
-
- self.setWait(wait)
- self.logDebug("Waiting %d seconds." % wait)
- self.wait()
-
- tm = re.search(self.WAIT_TM_PATTERN, self.html)
- tm_hash = re.search(self.WAIT_TM_HASH_PATTERN, self.html)
-
- if tm and tm_hash:
- tm = tm.group(1)
- tm_hash = tm_hash.group(1)
- self.html = self.load(url, post={"tm": tm, "tm_hash": tm_hash})
- self.handleErrors()
- break
- else:
- self.html = self.load(url)
- self.handleErrors()
- waitSearch = re.search(self.WAIT_TIME_PATTERN, self.html)
-
- def handleErrors(self):
- if "This file is available for premium users only." in self.html:
- self.fail("need premium account for file")
-
- if "The file that you're trying to download is larger than" in self.html:
- self.fail("need premium account for file")
-
- if "Free users may only download 1 file at a time" in self.html:
- self.fail("only 1 file at a time for free users")
-
- if "Free user can not download files" in self.html:
- self.fail("need premium account for file")
-
- if "Download session in progress" in self.html:
- self.fail("already downloading")
-
- if "This file is password protected" in self.html:
- self.fail("This file is password protected")
-
- if "An Error Occurred" in self.html:
- self.fail("A server error occured.")
-
- if "This file was deleted" in self.html:
- self.offline()
diff --git a/module/plugins/hoster/KickloadCom.py b/module/plugins/hoster/KickloadCom.py
deleted file mode 100644
index 9f1e5083d..000000000
--- a/module/plugins/hoster/KickloadCom.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/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"<span class=\"orange\">Downloading:</span>(.*?)<span class=\"light\">(.*?)</span>"
- return re.search(file_name_pattern, self.html).group(1).strip()
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
deleted file mode 100644
index 336cbfb58..000000000
--- a/module/plugins/hoster/MegauploadCom.py
+++ /dev/null
@@ -1,175 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from time import sleep
-
-from module.plugins.Hoster import Hoster
-
-from module.network.RequestFactory import getURL
-from module.network.HTTPRequest import BadHeader
-
-from module.utils import html_unescape
-from module.PyFile import statusMap
-
-from pycurl import error
-
-def getInfo(urls):
- yield [(url, 0, 1, url) for url in urls]
-
-
-def _translateAPIFileInfo(apiFileId, apiFileDataMap, apiHosterMap):
-
- # Translate
- fileInfo = {}
- try:
- fileInfo['status'] = MegauploadCom.API_STATUS_MAPPING[apiFileDataMap[apiFileId]]
- fileInfo['name'] = html_unescape(apiFileDataMap['n'])
- fileInfo['size'] = int(apiFileDataMap['s'])
- fileInfo['hoster'] = apiHosterMap[apiFileDataMap['d']]
- except:
- pass
-
- return fileInfo
-
-class MegauploadCom(Hoster):
- __name__ = "MegauploadCom"
- __type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=(?P<id>[0-9A-Za-z]+)"
- __version__ = "0.32"
- __description__ = """Megaupload.com Download Hoster"""
- __author_name__ = ("spoob")
- __author_mail__ = ("spoob@pyload.org")
-
- API_URL = "http://megaupload.com/mgr_linkcheck.php"
- API_STATUS_MAPPING = {"0": statusMap['online'], "1": statusMap['offline'], "3": statusMap['temp. offline']}
-
- FILE_URL_PATTERN = r'<a href="([^"]+)" class="download_regular_usual"'
- PREMIUM_URL_PATTERN = r'href=\"(http://[^\"]*?)\" class=\"download_premium_but\">'
-
- def init(self):
- self.html = [None, None]
- if self.account:
- self.premium = self.account.getAccountInfo(self.user)["premium"]
-
- if not self.premium:
- self.multiDL = False
- self.chunkLimit = 1
-
- self.api = {}
-
- self.fileID = re.search(self.__pattern__, self.pyfile.url).group("id")
- self.pyfile.url = "http://www.megaupload.com/?d=" + self.fileID
-
-
- def process(self, pyfile):
- self.fail("Hoster not longer available")
-
- def download_html(self):
- for i in range(3):
- self.html[0] = self.load(self.pyfile.url)
- self.html[1] = self.html[0] # in case of no captcha, this already contains waiting time, etc
- count = 0
- if "The file that you're trying to download is larger than 1 GB" in self.html[0]:
- self.fail(_("You need premium to download files larger than 1 GB"))
-
- if re.search(r'<input[^>]*name="filepassword"', self.html[0]):
- pw = self.getPassword()
- if not pw:
- self.fail(_("The file is password protected, enter a password and restart."))
-
- self.html[1] = self.load(self.pyfile.url, post={"filepassword":pw})
- break # looks like there is no captcha for pw protected files
-
- while "document.location='http://www.megaupload.com/?c=msg" in self.html[0]:
- # megaupload.com/?c=msg usually says: Please check back in 2 minutes,
- # so we can spare that http request
- self.setWait(120)
- if count > 1:
- self.wantReconnect = True
-
- self.wait()
-
- self.html[0] = self.load(self.pyfile.url)
- count += 1
- if count > 5:
- self.fail(_("Megaupload is currently blocking your IP. Try again later, manually."))
-
- try:
- url_captcha_html = re.search('(http://[\w\.]*?megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1)
- except:
- continue
-
- captcha = self.decryptCaptcha(url_captcha_html)
- captchacode = re.search('name="captchacode" value="(.*)"', self.html[0]).group(1)
- megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1)
- self.html[1] = self.load(self.pyfile.url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar})
- if re.search(r"Waiting time before each download begins", self.html[1]) is not None:
- break
-
- def download_api(self):
-
- # MU API request
- fileId = self.pyfile.url.split("=")[-1] # Get file id from url
- apiFileId = "id0"
- post = {apiFileId: fileId}
- response = getURL(self.API_URL, post=post, decode = True)
- self.log.debug("%s: API response [%s]" % (self.__name__, response))
-
- # Translate API response
- parts = [re.split(r"&(?!amp;|#\d+;)", x) for x in re.split(r"&?(?=id[\d]+=)", response)]
- apiHosterMap = dict([elem.split('=') for elem in parts[0]])
- apiFileDataMap = dict([elem.split('=') for elem in parts[1]])
- self.api = _translateAPIFileInfo(apiFileId, apiFileDataMap, apiHosterMap)
-
- # File info
- try:
- self.pyfile.status = self.api['status']
- self.pyfile.name = self.api['name']
- self.pyfile.size = self.api['size']
- except KeyError:
- self.log.warn("%s: Cannot recover all file [%s] info from API response." % (self.__name__, fileId))
-
- # Fail if offline
- if self.pyfile.status == statusMap['offline']:
- self.offline()
-
- def get_file_url(self):
- search = re.search(self.FILE_URL_PATTERN, self.html[1])
- return search.group(1).replace(" ", "%20") if search else None
-
- def get_file_name(self):
- try:
- name = self.api["name"]
- except KeyError:
- file_name_pattern = 'id="downloadlink"><a href="(.*)" onclick="'
- name = re.search(file_name_pattern, self.html[1]).group(1).split("/")[-1]
-
- return html_unescape(name)
-
- def get_wait_time(self):
- time = re.search(r"count=(\d+);", self.html[1])
- if time:
- return time.group(1)
- else:
- return 60
-
- def file_exists(self):
- #self.download_html()
- if re.search(r"Unfortunately, the link you have clicked is not available.", self.html[0]) is not None or \
- re.search(r"Download limit exceeded", self.html[0]) is not None:
- return False
-
- if re.search("The file you are trying to access is temporarily unavailable", self.html[0]) is not None:
- self.setWait(120)
- self.log.debug("%s: The file is temporarily not available. Waiting 2 minutes." % self.__name__)
- self.wait()
-
- self.download_html()
- if re.search("The file you are trying to access is temporarily unavailable", self.html[0]) is not None:
- self.fail(_("Looks like the file is still not available. Retry downloading later, manually."))
-
- if re.search("The password you have entered is not correct", self.html[1]):
- self.fail(_("Wrong password for download link."))
-
- return True
diff --git a/module/plugins/hoster/MegavideoCom.py b/module/plugins/hoster/MegavideoCom.py
deleted file mode 100644
index fa5d87993..000000000
--- a/module/plugins/hoster/MegavideoCom.py
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from time import time
-from module.plugins.Hoster import Hoster
-from module.unescape import unescape
-
-class MegavideoCom(Hoster):
- __name__ = "MegavideoCom"
- __type__ = "hoster"
- __pattern__ = r"http://(www\.)?megavideo.com/\?v=.*"
- __version__ = "0.2"
- __description__ = """Megavideo.com Download Hoster"""
- __author_name__ = ("jeix","mkaay")
- __author_mail__ = ("jeix@hasnomail.de","mkaay@mkaay.de")
-
- def setup(self):
- self.html = None
-
- def process(self, pyfile):
- self.pyfile = pyfile
-
- if not self.file_exists():
- self.offline()
-
- self.pyfile.name = self.get_file_name()
- self.download( self.get_file_url() )
-
- def download_html(self):
- url = self.pyfile.url
- self.html = self.req.load(url)
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html is None:
- self.download_html()
-
- # get id
- id = re.search("previewplayer/\\?v=(.*?)&width", self.html).group(1)
-
- # check for hd link and return if there
- if "flashvars.hd = \"1\";" in self.html:
- content = self.req.load("http://www.megavideo.com/xml/videolink.php?v=%s" % id)
- return unescape(re.search("hd_url=\"(.*?)\"", content).group(1))
-
- # else get normal link
- s = re.search("flashvars.s = \"(\\d+)\";", self.html).group(1)
- un = re.search("flashvars.un = \"(.*?)\";", self.html).group(1)
- k1 = re.search("flashvars.k1 = \"(\\d+)\";", self.html).group(1)
- k2 = re.search("flashvars.k2 = \"(\\d+)\";", self.html).group(1)
- return "http://www%s.megavideo.com/files/%s/" % (s, self.__decrypt(un, int(k1), int(k2)))
-
- def __decrypt(self, input, k1, k2):
- req1 = []
- req3 = 0
- for c in input:
- c = int(c, 16)
- tmp = "".join([str((c >> y) & 1) for y in range(4 -1, -1, -1)])
- req1.extend([int(x) for x in tmp])
-
- req6 = []
- req3 = 0
- while req3 < 384:
- k1 = (k1 * 11 + 77213) % 81371
- k2 = (k2 * 17 + 92717) % 192811
- req6.append((k1 + k2) % 128)
- req3 += 1
-
- req3 = 256
- while req3 >= 0:
- req5 = req6[req3]
- req4 = req3 % 128
- req8 = req1[req5]
- req1[req5] = req1[req4]
- req1[req4] = req8
- req3 -= 1
-
- req3 = 0
- while req3 < 128:
- req1[req3] = req1[req3] ^ (req6[req3+256] & 1)
- req3 += 1
-
- out = ""
- req3 = 0
- while req3 < len(req1):
- tmp = req1[req3] * 8
- tmp += req1[req3+1] * 4
- tmp += req1[req3+2] * 2
- tmp += req1[req3+3]
-
- out += "%X" % tmp
-
- req3 += 4
-
- return out.lower()
-
- def get_file_name(self):
- if self.html is None:
- self.download_html()
-
- name = re.search("flashvars.title = \"(.*?)\";", self.html).group(1)
- name = "%s.flv" % unescape(name.encode("ascii", "ignore")).decode("utf-8").encode("ascii", "ignore").replace("+", " ")
- return name
-
- def file_exists(self):
- """ returns True or False
- """
- if self.html is None:
- self.download_html()
-
- if re.search(r"Dieses Video ist nicht verfügbar.", self.html) is not None or \
- re.search(r"This video is unavailable.", self.html) is not None:
- return False
- else:
- return True
-
diff --git a/module/plugins/hoster/NahrajCz.py b/module/plugins/hoster/NahrajCz.py
deleted file mode 100644
index 634c1af7d..000000000
--- a/module/plugins/hoster/NahrajCz.py
+++ /dev/null
@@ -1,54 +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: zoidberg
-"""
-
-import re
-from module.plugins.Hoster import Hoster
-
-class NahrajCz(Hoster):
- __name__ = "NahrajCz"
- __type__ = "hoster"
- __pattern__ = r"http://.*nahraj.cz/content/download/.*"
- __version__ = "0.2"
- __description__ = """nahraj.cz"""
- __author_name__ = ("zoidberg")
-
- FILE_URL_PATTERN = r'<form id="forwarder" method="post"[^>]*action="([^"]+/([^/"]+))">'
- SUBMIT_PATTERN = r'<input id="submit" type="submit" value="([^"]+)" name="submit"/>'
- #ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>'
-
- def setup(self):
- self.multiDL = False
-
- def process(self, pyfile):
- self.html = self.load(pyfile.url)
-
- found = re.search(self.FILE_URL_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (URL)")
- parsed_url = found.group(1)
- pyfile.name = found.group(2)
-
- found = re.search(self.SUBMIT_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (SUBMIT)")
- submit = found.group(1)
-
- self.download(parsed_url, disposition=True, post={
- "submit": submit
- })
- \ No newline at end of file
diff --git a/module/plugins/hoster/OronCom.py b/module/plugins/hoster/OronCom.py
deleted file mode 100755
index 864b7e96a..000000000
--- a/module/plugins/hoster/OronCom.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# -*- coding: utf-8 -*-
-import re
-
-from module.plugins.Hoster import Hoster
-from module.network.RequestFactory import getURL
-from module.plugins.ReCaptcha import ReCaptcha
-from module.utils import parseFileSize
-
-def getInfo(urls):
- result = []
-
- for url in urls:
- html = getURL(url).replace("\n", "")
- html = html.replace("\t", "")
- if "File could not be found" in html:
- result.append((url, 0, 1, url))
- continue
-
- m = re.search(OronCom.FILE_INFO_PATTERN, html, re.MULTILINE)
- if m:
- name = m.group(1)
- size = parseFileSize(m.group(2), m.group(3))
- else:
- name = url
- size = 0
-
- result.append((name, size, 2, url))
- yield result
-
-
-class OronCom(Hoster):
- __name__ = "OronCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www.)?oron.com/(?!folder)\w+"
- __version__ = "0.16"
- __description__ = "Oron.com Hoster Plugin"
- __author_name__ = ("chrox", "DHMH")
- __author_mail__ = ("chrox@pyload.org", "webmaster@pcProfil.de")
-
- FILE_INFO_PATTERN = r'(?:Filename|Dateiname): <b class="f_arial f_14px">(.*?)</b>\s*<br>\s*(?:Größe|File size): ([0-9,\.]+) (Kb|Mb|Gb)'
-
- def init(self):
- self.resumeDownload = self.multiDL = True if self.account else False
- self.chunkLimit = 1
- self.file_id = re.search(r'http://(?:www.)?oron.com/([a-zA-Z0-9]+)', self.pyfile.url).group(1)
- self.logDebug("File id is %s" % self.file_id)
- self.pyfile.url = "http://oron.com/" + self.file_id
-
- def process(self, pyfile):
- #self.load("http://oron.com/?op=change_lang&lang=german")
- # already logged in, so the above line shouldn't be necessary
- self.html = self.load(self.pyfile.url, ref=False, decode=True).encode("utf-8").replace("\n", "")
- if "File could not be found" in self.html or "Datei nicht gefunden" in self.html or \
- "This file has been blocked for TOS violation." in self.html:
- self.offline()
- self.html = self.html.replace("\t", "")
- m = re.search(self.FILE_INFO_PATTERN, self.html)
- if m:
- pyfile.name = m.group(1)
- pyfile.size = parseFileSize(m.group(2), m.group(3))
- self.logDebug("File Size: %s" % pyfile.formatSize())
- else:
- self.logDebug("Name and/or size not found.")
-
- if self.account:
- self.handlePremium()
- else:
- self.handleFree()
-
- def handleFree(self):
- #self.load("http://oron.com/?op=change_lang&lang=german")
- # already logged in, so the above line shouldn't be necessary
- self.html = self.load(self.pyfile.url, ref=False, decode=True).replace("\n", "")
- if "download1" in self.html:
- post_url = "http://oron.com/" + self.file_id
- post_dict = {'op': 'download1',
- 'usr_login': '',
- 'id': self.file_id,
- 'fname': self.pyfile.name,
- 'referer': '',
- 'method_free': ' Regular Download '}
-
- self.html = self.load(post_url, post=post_dict, ref=False, decode=True).encode("utf-8")
- if '<p class="err">' in self.html:
- time_list = re.findall(r'\d+(?=\s[a-z]+,)|\d+(?=\s.*?until)', self.html)
- tInSec = 0
- for t in time_list:
- tInSec += int(t) * 60 ** (len(time_list) - time_list.index(t) - 1)
- self.setWait(tInSec, True)
- self.wait()
- self.retry()
-
- if "download2" in self.html:
- post_dict['op'] = 'download2'
- post_dict['method_free'] = 'Regular Download'
- post_dict['method_premium'] = ''
- post_dict['down_direct'] = '1'
- post_dict['btn_download'] = ' Create Download Link '
- del(post_dict['fname'])
-
- re_captcha = ReCaptcha(self)
- downloadLink = None
- for i in range(5):
- m = re.search('name="rand" value="(.*?)">', self.html)
- post_dict['rand'] = m.group(1)
- challengeId = re.search(r'/recaptcha/api/challenge[?k=]+([^"]+)', self.html)
- challenge, result = re_captcha.challenge(challengeId.group(1))
- post_dict['recaptcha_challenge_field'] = challenge
- post_dict['recaptcha_response_field'] = result
- self.html = self.load(post_url, post=post_dict)
- m = re.search('<p class="err">(.*?)</p>', self.html)
- if m:
- if m.group(1) == "Wrong captcha":
- self.invalidCaptcha()
- self.logDebug("Captcha failed")
- if 'class="atitle">Download File' in self.html:
- self.correctCaptcha()
- downloadLink = re.search('href="(.*?)" class="atitle"', self.html)
- break
-
- if not downloadLink:
- self.fail("Could not find download link")
-
- self.logDebug("Download url found: %s" % downloadLink.group(1))
- self.download(downloadLink.group(1))
- else:
- self.logError("error in parsing site")
-
- def handlePremium(self):
- info = self.account.getAccountInfo(self.user, True)
- self.logDebug("Traffic left: %s" % info['trafficleft'])
- self.logDebug("File Size: %d" % int(self.pyfile.size / 1024))
-
- if int(self.pyfile.size / 1024) > info["trafficleft"]:
- self.logInfo(_("Not enough traffic left"))
- self.account.empty(self.user)
- self.fail(_("Traffic exceeded"))
-
- post_url = "http://oron.com/" + self.file_id
- m = re.search('name="rand" value="(.*?)">', self.html)
- rand = m.group(1)
- post_dict = {'down_direct': '1', 'id': self.file_id, 'op': 'download2', 'rand': rand, 'referer': '',
- 'method_free': '', 'method_premium': '1'}
-
- self.html = self.load(post_url, post=post_dict, ref=False, decode=True).encode("utf-8")
- link = re.search('href="(.*?)" class="atitle"', self.html).group(1)
- self.download(link)
diff --git a/module/plugins/hoster/PrzeklejPl.py b/module/plugins/hoster/PrzeklejPl.py
deleted file mode 100644
index e97fb551e..000000000
--- a/module/plugins/hoster/PrzeklejPl.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: zoidberg
-"""
-
-import re
-from module.plugins.Hoster import Hoster
-
-class PrzeklejPl(Hoster):
- __name__ = "PrzeklejPl"
- __type__ = "hoster"
- __pattern__ = r"http://.*przeklej.pl/plik/.*"
- __version__ = "0.1"
- __description__ = """przeklej.pl"""
- __author_name__ = ("zoidberg")
-
- FILE_URL_PATTERN = r'<a href="([^"]+)" title="Pobierz plik">([^<]+)</a>'
-
- #ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>'
-
- def setup(self):
- self.multiDL = True
-
- def process(self, pyfile):
- self.html = self.load(pyfile.url, decode=True)
-
- found = re.search(self.FILE_URL_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (URL)")
- parsed_url = found.group(1)
- pyfile.name = found.group(2)
-
- self.download("http://www.przeklej.pl" + parsed_url)
- \ No newline at end of file
diff --git a/module/plugins/hoster/StahnuTo.py b/module/plugins/hoster/StahnuTo.py
deleted file mode 100644
index 354a99b1a..000000000
--- a/module/plugins/hoster/StahnuTo.py
+++ /dev/null
@@ -1,63 +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: zoidberg
-"""
-
-import re
-from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
-from module.network.RequestFactory import getURL
-
-def getInfo(urls):
- result = []
-
- for url in urls:
- file_info = parseFileInfo(StahnuTo, url, getURL("http://stahnu.to/?file=" + re.search(StahnuTo.__pattern__, url).group(3), decode=True))
- result.append(file_info)
-
- yield result
-
-class StahnuTo(SimpleHoster):
- __name__ = "StahnuTo"
- __type__ = "hoster"
- __pattern__ = r"http://(?:\w*\.)?stahnu.to/(?:files/get/|.*\?file=)(?P<ID>[^/]+).*"
- __version__ = "0.14"
- __description__ = """stahnu.to"""
- __author_name__ = ("zoidberg")
-
- FILE_NAME_PATTERN = r"<td colspan='2'>N&aacute;zev souboru<br /><span>(?P<N>[^<]+)</span>"
- FILE_SIZE_PATTERN = r'<td>Velikost souboru<br /><span>(?P<S>[^<]+)\s*(?P<U>[kKMG])i?[Bb]</span></td>'
- FILE_OFFLINE_PATTERN = r'<!-- Obsah - start -->\s*<!-- Obsah - end -->'
-
- def setup(self):
- self.multiDL = True
-
- def process(self, pyfile):
- if not self.account:
- self.fail("Please enter your stahnu.to account")
-
- found = re.search(self.__pattern__, pyfile.url)
- file_id = found.group(1)
-
- self.html = self.load("http://www.stahnu.to/getfile.php?file=%s" % file_id, decode=True)
- self.getFileInfo()
-
- if "K sta&#382;en&iacute; souboru se mus&iacute;te <strong>zdarma</strong> p&#345;ihl&aacute;sit!" in self.html:
- self.account.relogin(self.user)
- self.retry()
-
- self.download("http://www.stahnu.to/files/gen/" + file_id, post={
- "downloadbutton": u"STÁHNOUT"
- })
diff --git a/module/plugins/hoster/UploadboxCom.py b/module/plugins/hoster/UploadboxCom.py
deleted file mode 100644
index ce80b37dc..000000000
--- a/module/plugins/hoster/UploadboxCom.py
+++ /dev/null
@@ -1,95 +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: zoidberg
-"""
-
-import re
-from module.plugins.internal.DeadHoster import DeadHoster as SimpleHoster
-
-"""
-from module.network.RequestFactory import getURL
-
-def getInfo(urls):
- for url in urls:
- file_id = re.search(UploadboxCom.__pattern__, url).group(1)
- html = getURL('http://uploadbox.com/files/%s/?ac=lang&lang_new=en' % file_id, decode = False)
- file_info = parseFileInfo(UploadboxCom, url, html)
- yield file_info
-"""
-
-class UploadboxCom(SimpleHoster):
- __name__ = "Uploadbox"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?uploadbox\.com/files/([^/]+).*"
- __version__ = "0.05"
- __description__ = """UploadBox.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_NAME_PATTERN = r'<p><span>File name:</span>\s*(?P<N>[^<]+)</p>'
- FILE_SIZE_PATTERN = r'<span>Size:</span>\s*(?P<S>[0-9.]+) (?P<U>[kKMG])i?B <span>'
- FILE_OFFLINE_PATTERN = r'<strong>File deleted from service</strong>'
- FILE_NAME_REPLACEMENTS = [(r"(.*)", lambda m: unicode(m.group(1), 'koi8_r'))]
-
- FREE_FORM_PATTERN = r'<form action="([^"]+)" method="post" id="free" name="free">(.*?)</form>'
- FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]+)" />'
- LIMIT_EXCEEDED_PATTERN = r'<strong>The limit of traffic for you is exceeded. Please </strong> <br />wait <strong>(\d+)</strong> minutes'
- DOWNLOAD_URL_PATTERN = r'<iframe id="file_download"[^>]*src="([^"]+)"></iframe>'
-
- def process(self, pyfile):
- self.file_id = re.search(self.__pattern__, pyfile.url).group(1)
- self.html = self.load('http://uploadbox.com/files/%s/?ac=lang&lang_new=en' % self.file_id, decode = False)
- self.getFileInfo()
- self.handleFree()
-
- def handleFree(self):
- # Solve captcha
- url = 'http://uploadbox.com/files/' + self.file_id
-
- for i in range(5):
- self.html = self.load(url, post = {"free": "yes"})
- found = re.search(self.LIMIT_EXCEEDED_PATTERN, self.html)
- if found:
- self.setWait(int(found.group(1))*60, True)
- self.wait()
- else:
- break
- else:
- self.fail("Unable to get free download slot")
-
- for i in range(5):
- try:
- action, form = re.search(self.FREE_FORM_PATTERN, self.html, re.DOTALL).groups()
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- except Exception, e:
- self.logError(e)
- self.fail("Parse error on page 2")
-
- captcha_url = 'http://uploadbox.com/?ac=captcha&code=' + inputs['code']
- inputs['enter'] = self.decryptCaptcha(captcha_url)
- self.html = self.load('http://uploadbox.com/' + action, post = inputs)
- found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
- if found:
- self.correctCaptcha()
- download_url = found.group(1)
- break
- else:
- self.invalidCaptcha()
- else:
- self.fail("Incorrect captcha entered 5 times")
-
- # Download
- self.download(download_url) \ No newline at end of file
diff --git a/module/plugins/hoster/UploadhereCom.py b/module/plugins/hoster/UploadhereCom.py
deleted file mode 100644
index 8deec1397..000000000
--- a/module/plugins/hoster/UploadhereCom.py
+++ /dev/null
@@ -1,34 +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: zoidberg
-"""
-
-from module.plugins.internal.DeadHoster import DeadHoster as UploadkingCom, create_getInfo
-#from module.plugins.internal.SimpleHoster import create_getInfo
-#from UploadkingCom import UploadkingCom
-
-class UploadhereCom(UploadkingCom):
- __name__ = "UploadhereCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?uploadhere\.com/\w{10}"
- __version__ = "0.12"
- __description__ = """Uploadhere.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- # shares code with UploadkingCom
-
-create_getInfo(UploadhereCom) \ No newline at end of file
diff --git a/module/plugins/hoster/UploadkingCom.py b/module/plugins/hoster/UploadkingCom.py
deleted file mode 100644
index be2d6c3bd..000000000
--- a/module/plugins/hoster/UploadkingCom.py
+++ /dev/null
@@ -1,44 +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: zoidberg
-"""
-
-import re
-from module.plugins.internal.DeadHoster import DeadHoster as SimpleHoster, create_getInfo
-#from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-
-class UploadkingCom(SimpleHoster):
- __name__ = "UploadkingCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?uploadking\.com/\w{10}"
- __version__ = "0.14"
- __description__ = """UploadKing.com plugin - free only"""
- __author_name__ = ("zoidberg")
- __author_mail__ = ("zoidberg@mujmail.cz")
-
- FILE_NAME_PATTERN = r'<font style="font-size:\d*px;">File(?:name)?:\s*<(?:b|/font><font[^>]*)>(?P<N>[^<]+)'
- FILE_SIZE_PATTERN = r'<font style="font-size:\d*px;">(?:Files|S)ize:\s*<(?:b|/font><font[^>]*)>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B'
- FILE_OFFLINE_PATTERN = r'<center><font[^>]*>Unfortunately, this file is unavailable</font></center>'
- FILE_URL_PATTERN = r'id="dlbutton"><a href="([^"]+)"'
-
- def handleFree(self):
- found = re.search(self.FILE_URL_PATTERN, self.html)
- if not found: self.fail("Download URL not found")
- url = found.group(1)
- self.logDebug("DOWNLOAD URL: " + url)
- self.download(url)
-
-create_getInfo(UploadkingCom) \ No newline at end of file
diff --git a/module/plugins/hoster/ZShareNet.py b/module/plugins/hoster/ZShareNet.py
deleted file mode 100644
index 6ef456d97..000000000
--- a/module/plugins/hoster/ZShareNet.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-import random
-
-from module.utils import parseFileSize
-from module.plugins.Hoster import Hoster
-
-class ZShareNet(Hoster):
- __name__ = "ZShareNet"
- __type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?zshare\.net/(download|video|image|audio|flash)/.*"
- __version__ = "0.2"
- __description__ = """ZShareNet Download Hoster"""
- __author_name__ = ("espes","Cptn Sandwich")
-
- def setup(self):
- self.multiDL = False
- self.html = None
-
- def process(self, pyfile):
- self.pyfile = pyfile
-
- self.pyfile.url = re.sub("(video|image|audio|flash)","download",self.pyfile.url)
-
- self.html = self.load(pyfile.url)
- if "File Not Found" in self.html:
- self.offline()
-
- filenameMatch = re.search("File Name:.*?<font color=\"#666666\".*?>(.*?)</font>", self.html, re.DOTALL)
- filesizeMatch = re.search("File Size:.*?<font color=\"#666666\".*?>([^<]+)</font>", self.html, re.DOTALL)
- if not filenameMatch or not filesizeMatch:
- self.offline()
- filename = filenameMatch.group(1)
- filesize = filesizeMatch.group(1)
- if filename.strip() == "":
- self.offline()
-
- pyfile.name = filename
-
- pyfile.size = parseFileSize(filesize)
-
- if '<input name="download"' not in self.html:
- self.fail("No download form")
-
- self.html = self.load(pyfile.url, post={
- "download": 1,
- "imageField.x": random.randrange(160),
- "imageField.y": random.randrange(60)})
-
- dllinkMatch = re.search("var link_enc\\=new Array\\(\\'(.*?)\\'\\)", self.html)
- if dllinkMatch:
- dllink = re.sub("\\'\\,\\'", "", dllinkMatch.group(1))
- else:
- self.fail("Plugin defect")
-
- self.setWait(51)
- self.wait()
-
- self.download(dllink)
- check = self.checkDownload({
- "unav": "/images/download.gif",
- "404": "404 - Not Found"
- })
- #print check
- if check == "unav":
- self.fail("Plugin defect")
- elif check == "404":
- self.offline()