diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-03-11 18:52:44 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-03-11 18:52:44 +0100 |
commit | 7cfd8dd192227c8f37861827a95852a4942694ef (patch) | |
tree | 80cafb9840e55ecaa88fca8981e08bf47c12ee84 | |
parent | multihoster config (diff) | |
download | pyload-7cfd8dd192227c8f37861827a95852a4942694ef.tar.xz |
hotfile patch by JoKoT3 - close #556, fix zippyshare, bitshare login
-rw-r--r-- | module/plugins/accounts/BitshareCom.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/HotfileCom.py | 28 | ||||
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 23 | ||||
-rw-r--r-- | module/plugins/hoster/HotfileCom.py | 29 | ||||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 13 | ||||
-rw-r--r-- | module/plugins/hoster/ZippyshareCom.py | 9 |
6 files changed, 55 insertions, 53 deletions
diff --git a/module/plugins/accounts/BitshareCom.py b/module/plugins/accounts/BitshareCom.py index b0cd1efcd..a4f56e31c 100644 --- a/module/plugins/accounts/BitshareCom.py +++ b/module/plugins/accounts/BitshareCom.py @@ -21,7 +21,7 @@ from module.plugins.Account import Account class BitshareCom(Account): __name__ = "BitshareCom" - __version__ = "0.1" + __version__ = "0.11" __type__ = "account" __description__ = """Bitshare account plugin""" __author_name__ = ("Paul King") @@ -39,6 +39,6 @@ class BitshareCom(Account): def login(self, user, data, req): - page = req.load("http://bitshare.com/login.html", post={ "user" : user, "pass" : data["password"], "submit" :"1"}, cookies=True) - if "Wrong Username or Password" in page: + page = req.load("http://bitshare.com/login.html", post={ "user" : user, "password" : data["password"], "submit" :"Login"}, cookies=True) + if "login" in req.lastEffectiveURL: self.wrongPassword() diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py index 9b54e6a3c..23e42dacf 100644 --- a/module/plugins/accounts/HotfileCom.py +++ b/module/plugins/accounts/HotfileCom.py @@ -14,7 +14,7 @@ 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 + @author: mkaay, JoKoT3 """ from module.plugins.Account import Account @@ -23,11 +23,11 @@ import hashlib class HotfileCom(Account): __name__ = "HotfileCom" - __version__ = "0.1" + __version__ = "0.2" __type__ = "account" __description__ = """hotfile.com account plugin""" - __author_name__ = ("mkaay") - __author_mail__ = ("mkaay@mkaay.de") + __author_name__ = ("mkaay","JoKoT3") + __author_mail__ = ("mkaay@mkaay.de","jokot3@gmail.com") def loadAccountInfo(self, user, req): resp = self.apiCall("getuserinfo", user=user) @@ -39,14 +39,18 @@ class HotfileCom(Account): key, value = p.split("=") info[key] = value - info["premium_until"] = info["premium_until"].replace("T"," ") - zone = info["premium_until"][19:] - info["premium_until"] = info["premium_until"][:19] - zone = int(zone[:3]) + if info['is_premium'] == '1': + info["premium_until"] = info["premium_until"].replace("T"," ") + zone = info["premium_until"][19:] + info["premium_until"] = info["premium_until"][:19] + zone = int(zone[:3]) + + validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone*3600) + tmp = {"validuntil":validuntil, "trafficleft":-1, "premium":True} - validuntil = int(mktime(strptime(info["premium_until"], "%Y-%m-%d %H:%M:%S"))) + (zone*3600) - - tmp = {"validuntil":validuntil, "trafficleft":-1} + elif info['is_premium'] == '0': + tmp = {"premium":False} + return tmp def apiCall(self, method, post={}, user=None): @@ -79,4 +83,4 @@ class HotfileCom(Account): page = req.load("http://hotfile.com/login.php", post={"returnto": "/", "user": user, "pass": data["password"]}, cookies=True) if "Bad username/password" in page: - self.wrongPassword() + self.wrongPassword()
\ No newline at end of file diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 70922b239..cdc4ebb63 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -23,34 +23,35 @@ import re class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" - __version__ = "0.22" + __version__ = "0.23" __type__ = "account" __description__ = """share-online.biz account plugin""" __author_name__ = ("mkaay", "zoidberg") __author_mail__ = ("mkaay@mkaay.de", "zoidberg@mujmail.cz") - info_threshold = 60 - + def getUserAPI(self, user, req): + return req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (user, self.accounts[user]["password"])) + def loadAccountInfo(self, user, req): - src = req.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=userDetails" % (user, self.accounts[user]["password"])) + src = self.getUserAPI(user, req) info = {} for line in src.splitlines(): if "=" in line: key, value = line.split("=") info[key] = value - + self.logDebug(info) + if "dl" in info and info["dl"].lower() != "not_available": req.cj.setCookie("share-online.biz", "dl", info["dl"]) if "a" in info and info["a"].lower() != "not_available": - req.cj.setCookie("share-online.biz", "a", info["a"]) + req.cj.setCookie("share-online.biz", "a", info["a"]) return {"validuntil": int(info["expire_date"]) if "expire_date" in info else -1, "trafficleft": -1, - "premium": True if ("dl" in info or "a" in info) and (info["group"] == "Premium") else False} + "premium": True if ("dl" in info or "a" in info) and (info["group"] != "Sammler") else False} def login(self, user, data, req): - req.lastURL = "http://www.share-online.biz/" - req.load("https://www.share-online.biz/user/login", cookies=True, post={ - "user": user, - "pass": data["password"]}) + src = self.getUserAPI(user, req) + if "EXCEPTION" in src: + self.wrongPassword()
\ No newline at end of file diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index 1447e7c9e..bf4250767 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -32,24 +32,26 @@ class HotfileCom(Hoster): __name__ = "HotfileCom" __type__ = "hoster" __pattern__ = r"http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/" - __version__ = "0.32" + __version__ = "0.34" __description__ = """Hotfile.com Download Hoster""" - __author_name__ = ("sitacuisses","spoob","mkaay") - __author_mail__ = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de") + __author_name__ = ("sitacuisses","spoob","mkaay","JoKoT3") + __author_mail__ = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de","jokot3@gmail.com") FILE_OFFLINE_PATTERN = r'File is removed' def setup(self): self.html = [None, None] self.wantReconnect = False - self.multiDL = False self.htmlwithlink = None self.url = None - if self.account: + if self.premium: self.multiDL = True self.resumeDownload = True self.chunkLimit = -1 + else: + self.multiDL = False + self.chunkLimit = 1 def apiCall(self, method, post, login=False): if not self.account and login: @@ -73,7 +75,7 @@ class HotfileCom(Hoster): pyfile.name = self.apiData["name"] - if not self.account: + if not self.premium: self.downloadHTML() if self.FILE_OFFLINE_PATTERN in self.html[0]: @@ -127,14 +129,9 @@ class HotfileCom(Hoster): free_limit_pattern = re.compile(r"timerend=d\.getTime\(\)\+(\d+);") matches = free_limit_pattern.findall(self.html[0]) if matches: - for match in matches: - if int(match) in (60000,15000,0): - continue - else: - waittime = int(match)/1000 + 65 - if waittime > 300: - self.wantReconnect = True - return waittime - return 65 + wait_time = (sum([int(match) for match in matches])/1000) or 60 + if wait_time > 300: + self.wantReconnect = True + return wait_time + 1 else: - self.fail("Don't know how long to wait. Cannot proceed.") + self.fail("Don't know how long to wait. Cannot proceed.")
\ No newline at end of file diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 70c1efe1d..6c188fc96 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -43,7 +43,7 @@ class ShareonlineBiz(Hoster): __name__ = "ShareonlineBiz" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?(share\-online\.biz|egoshare\.com)/(download.php\?id\=|dl/)[\w]+" - __version__ = "0.25" + __version__ = "0.26" __description__ = """Shareonline.biz Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -56,7 +56,7 @@ class ShareonlineBiz(Hoster): self.pyfile.url = "http://www.share-online.biz/dl/" + self.file_id self.resumeDownload = self.multiDL = self.premium - self.chunkLimit = 1 + #self.chunkLimit = 1 def process(self, pyfile): if self.premium: @@ -66,13 +66,11 @@ class ShareonlineBiz(Hoster): self.handleFree() check = self.checkDownload({"invalid" : re.compile("<strong>(This download ticket is.*?)</strong>"), - "error" : "Es ist ein unbekannter Fehler aufgetreten"}) - if check == "invalid": + "error" : re.compile("(Es ist ein unbekannter Fehler aufgetreten|An unknown error has occurred)")}) + if check in ("invalid", "error"): self.logError(self.lastCheck.group(1)) - if self.premium: self.account.relogin() + if self.premium: self.account.getAccountInfo(self.user, force = True) self.retry(reason=_("Invalid download ticket")) - elif check == "error": - self.fail(reason=_("ShareOnline internal problems")) def downloadAPIData(self): api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1" @@ -129,6 +127,7 @@ class ShareonlineBiz(Hoster): self.download(download_url) def handleAPIPremium(self): #should be working better + self.account.getAccountInfo(self.user) src = self.load("http://api.share-online.biz/account.php?username=%s&password=%s&act=download&lid=%s" % (self.user, self.account.accounts[self.user]["password"], self.file_id), post={}) self.api_data = dlinfo = {} for line in src.splitlines(): diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py index a0c70d7bb..0dde85e2c 100644 --- a/module/plugins/hoster/ZippyshareCom.py +++ b/module/plugins/hoster/ZippyshareCom.py @@ -10,7 +10,7 @@ class ZippyshareCom(SimpleHoster): __name__ = "ZippyshareCom" __type__ = "hoster" __pattern__ = r"(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)" - __version__ = "0.32" + __version__ = "0.33" __description__ = """Zippyshare.com Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") @@ -19,7 +19,7 @@ class ZippyshareCom(SimpleHoster): FILE_SIZE_PATTERN = r'>Size:</font>\s*<font [^>]*>(?P<S>[0-9.,]+) (?P<U>[kKMG]+)i?B</font><br />' FILE_OFFLINE_PATTERN = r'>File does not exist on this server</div>' - DOWNLOAD_URL_PATTERN = r"document\.getElementById\('dlbutton'\).href = ([^;]+);" + DOWNLOAD_URL_PATTERN = r">([^<>]*)document\.getElementById\('dlbutton'\).href = ([^;]+);" SEED_PATTERN = r'swfobject.embedSWF\("([^"]+)".*?seed: (\d+)' CAPTCHA_KEY_PATTERN = r'Recaptcha.create\("([^"]+)"' CAPTCHA_SHORTENCODE_PATTERN = r"shortencode: '([^']+)'" @@ -57,10 +57,11 @@ class ZippyshareCom(SimpleHoster): """ url = multiply = modulo = None - found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + found = re.search(self.DOWNLOAD_URL_PATTERN, self.html, re.S) if found: #Method #1: JS eval - url = self.js.eval(found.group(1)) + self.logDebug("JS", found.groups()) + url = self.js.eval("%s%s" % (found.group(1), found.group(2))) else: #Method #2: SWF eval seed_search = re.search(self.SEED_PATTERN, self.html) |