From de034056468bb5cea26351be1d76f01fd2826395 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Fri, 12 Oct 2012 23:53:45 +0200 Subject: Cleanup. --- module/plugins/accounts/CoolshareCz.py | 71 ---------- module/plugins/accounts/FilesonicCom.py | 70 ---------- module/plugins/accounts/MegauploadCom.py | 53 -------- module/plugins/accounts/OronCom.py | 54 -------- module/plugins/hoster/CoolshareCz.py | 61 --------- module/plugins/hoster/EnteruploadCom.py | 82 ------------ module/plugins/hoster/FiledinoCom.py | 21 --- module/plugins/hoster/FilesonicCom.py | 217 ------------------------------- module/plugins/hoster/KickloadCom.py | 96 -------------- module/plugins/hoster/MegauploadCom.py | 175 ------------------------- module/plugins/hoster/MegavideoCom.py | 118 ----------------- module/plugins/hoster/NahrajCz.py | 54 -------- module/plugins/hoster/OronCom.py | 147 --------------------- module/plugins/hoster/PrzeklejPl.py | 47 ------- module/plugins/hoster/StahnuTo.py | 63 --------- module/plugins/hoster/UploadboxCom.py | 95 -------------- module/plugins/hoster/UploadhereCom.py | 34 ----- module/plugins/hoster/UploadkingCom.py | 44 ------- module/plugins/hoster/ZShareNet.py | 70 ---------- 19 files changed, 1572 deletions(-) delete mode 100644 module/plugins/accounts/CoolshareCz.py delete mode 100644 module/plugins/accounts/FilesonicCom.py delete mode 100644 module/plugins/accounts/MegauploadCom.py delete mode 100755 module/plugins/accounts/OronCom.py delete mode 100644 module/plugins/hoster/CoolshareCz.py delete mode 100644 module/plugins/hoster/EnteruploadCom.py delete mode 100644 module/plugins/hoster/FiledinoCom.py delete mode 100644 module/plugins/hoster/FilesonicCom.py delete mode 100644 module/plugins/hoster/KickloadCom.py delete mode 100644 module/plugins/hoster/MegauploadCom.py delete mode 100644 module/plugins/hoster/MegavideoCom.py delete mode 100644 module/plugins/hoster/NahrajCz.py delete mode 100755 module/plugins/hoster/OronCom.py delete mode 100644 module/plugins/hoster/PrzeklejPl.py delete mode 100644 module/plugins/hoster/StahnuTo.py delete mode 100644 module/plugins/hoster/UploadboxCom.py delete mode 100644 module/plugins/hoster/UploadhereCom.py delete mode 100644 module/plugins/hoster/UploadkingCom.py delete mode 100644 module/plugins/hoster/ZShareNet.py 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 . - - @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'
  • Neomezené stahování do: (.+?)<' - TRAFFIC_LEFT_PATTERN = ur'
  • Kredit: .*?\(\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(" ","")) // 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 '

    ' 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 . - - @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 . - - @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'

  • Velikost: (?P[^<]+)' - FILE_OFFLINE_PATTERN = r'

    Soubor nenalezen

    ' - - 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 . - - @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'

    (?P[^<]+)

    \s*File size:\s*(?P[0-9.]+)\s*(?P[kKMG])i?B' - FILE_OFFLINE_PATTERN = r'<(b|h2)>File Not Found|No such file with this filename' - 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'
    (.*?)
    ' - FORM2_PATTERN = r'
    ]*>(.*?)
    ' - FORM3_PATTERN = r'
    ' - FORM_INPUT_PATTERN = r']* name="([^"]+)" value="([^"]*)"[^>]*>' - WAIT_PATTERN = r'Wait <[^>]*>(\d+) seconds' - - 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)[^>]*>(?P.+?)' - 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.*?)(?P.(filesonic|sharingmatrix)\..+?)(?P/.*)' - FILE_ID_PATTERN = r'/file/(?P([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful - FILE_LINK_PATTERN = r'Your download is ready

    \s*\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() 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"Downloading:(.*?)(.*?)" - 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[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'' - - 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']*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">> 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 . - - @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']*action="([^"]+/([^/"]+))">' - SUBMIT_PATTERN = r'' - #ERR_PATTERN = r'

    Chyba: ([^<]+)

    ' - - 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): (.*?)\s*
    \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 '

    ' 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('

    (.*?)

    ', 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 . - - @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'
    ([^<]+)' - - #ERR_PATTERN = r'

    Chyba: ([^<]+)

    ' - - 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 . - - @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[^/]+).*" - __version__ = "0.14" - __description__ = """stahnu.to""" - __author_name__ = ("zoidberg") - - FILE_NAME_PATTERN = r"Název souboru
    (?P[^<]+)" - FILE_SIZE_PATTERN = r'Velikost souboru
    (?P[^<]+)\s*(?P[kKMG])i?[Bb]' - FILE_OFFLINE_PATTERN = r'\s*' - - 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žení souboru se musíte zdarma přihlá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 . - - @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'

    File name:\s*(?P[^<]+)

    ' - FILE_SIZE_PATTERN = r'Size:\s*(?P[0-9.]+) (?P[kKMG])i?B ' - FILE_OFFLINE_PATTERN = r'File deleted from service' - FILE_NAME_REPLACEMENTS = [(r"(.*)", lambda m: unicode(m.group(1), 'koi8_r'))] - - FREE_FORM_PATTERN = r'(.*?)' - FORM_INPUT_PATTERN = r']* name="([^"]+)" value="([^"]+)" />' - LIMIT_EXCEEDED_PATTERN = r'The limit of traffic for you is exceeded. Please
    wait (\d+) minutes' - DOWNLOAD_URL_PATTERN = r'' - - 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 . - - @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 . - - @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'File(?:name)?:\s*<(?:b|/font>]*)>(?P[^<]+)' - FILE_SIZE_PATTERN = r'(?:Files|S)ize:\s*<(?:b|/font>]*)>(?P[0-9.]+) (?P[kKMG])i?B' - FILE_OFFLINE_PATTERN = r'
    ]*>Unfortunately, this file is unavailable
    ' - FILE_URL_PATTERN = r'id="dlbutton">(.*?)
    ", self.html, re.DOTALL) - filesizeMatch = re.search("File Size:.*?([^<]+)", 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 '