From 7f239b41cb29ee95c878f78a6e9cacd55f301a8d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 13 Dec 2013 11:20:19 +0100 Subject: Some hosters marked as dead Merged #375 --- module/plugins/hoster/WuploadCom.py | 230 +----------------------------------- 1 file changed, 4 insertions(+), 226 deletions(-) (limited to 'module/plugins/hoster/WuploadCom.py') diff --git a/module/plugins/hoster/WuploadCom.py b/module/plugins/hoster/WuploadCom.py index aaeeb59fd..68e83e228 100644 --- a/module/plugins/hoster/WuploadCom.py +++ b/module/plugins/hoster/WuploadCom.py @@ -1,239 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import re -import string -from urllib import unquote +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from module.plugins.Hoster import Hoster -from module.plugins.internal.CaptchaService 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): - for chunk in chunks(urls, 20): - result = [] - ids = dict() - for url in chunk: - id = getId(url) - if id: - ids[id] = url - else: - result.append((None, 0, 1, url)) - - if len(ids) > 0: - check_url = "http://api.wupload.com/link?method=getInfo&format=json&ids=" + ",".join(ids.keys()) - response = json_loads(getURL(check_url).decode("utf8", "ignore")) - for item in response["FSApi_Link"]["getInfo"]["response"]["links"]: - if item["status"] != "AVAILABLE": - result.append((None, 0, 1, ids[str(item["id"])])) - else: - result.append((unquote(item["filename"]), item["size"], 2, ids[str(item["id"])])) - yield result - - -def getId(url): - match = re.search(WuploadCom.FILE_ID_PATTERN, url) - if match: - return string.replace(match.group("id"), "/", "-") - else: - return None - - -class WuploadCom(Hoster): +class WuploadCom(DeadHoster): __name__ = "WuploadCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?wupload\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Wupload com""" __author_name__ = ("jeix", "paulking") __author_mail__ = ("jeix@hasnomail.de", "") - API_ADDRESS = "http://api.wupload.com" - URL_DOMAIN_PATTERN = r'(?P.*?)(?P.wupload\..+?)(?P/.*)' - FILE_ID_PATTERN = r'/file/(?P([a-z][0-9]+/)?[0-9]+)(/.*)?' - FILE_LINK_PATTERN = r'

Download Now' - WAIT_TIME_PATTERN = r'countDownDelay = (?P\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"> 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() +getInfo = create_getInfo(WuploadCom) -- cgit v1.2.3