From fd98148e8887cd08fd3eeab595efd988e66d04d4 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Wed, 19 Sep 2012 00:30:30 +0200 Subject: update hellshare/hellspy patterns --- module/plugins/hoster/HellshareCz.py | 6 +++--- module/plugins/hoster/HellspyCz.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index 0add79ed9..9b50f55dc 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -26,14 +26,14 @@ class HellshareCz(SimpleHoster): __name__ = "HellshareCz" __type__ = "hoster" __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu)/[^?]*/\d+).*" - __version__ = "0.77" + __version__ = "0.78" __description__ = """Hellshare.cz""" __author_name__ = ("zoidberg") FREE_URL_PATTERN = r']*action="(http://free\d*\.helldata[^"]*)"' PREMIUM_URL_PATTERN = r"launchFullDownload\('([^']*)'\);" - FILE_NAME_PATTERN = r'

(?P[^<]+)

' - FILE_SIZE_PATTERN = r'Size\s*(?P[0-9.]*) (?P[kKMG])i?B' + FILE_NAME_PATTERN = r'

]*>(?P[^<]+)

' + FILE_SIZE_PATTERN = r'(?P[0-9.]*) (?P[kKMG])i?B' FILE_OFFLINE_PATTERN = r'

File not found.

' CAPTCHA_PATTERN = r'' #FILE_CREDITS_PATTERN = r'(\d+) MB' diff --git a/module/plugins/hoster/HellspyCz.py b/module/plugins/hoster/HellspyCz.py index a03e2bf21..22838b481 100644 --- a/module/plugins/hoster/HellspyCz.py +++ b/module/plugins/hoster/HellspyCz.py @@ -23,12 +23,12 @@ class HellspyCz(SimpleHoster): __name__ = "HellspyCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*hellspy\.(?:cz|com|sk|hu)(/\S+/\d+)/?.*" - __version__ = "0.24" + __version__ = "0.25" __description__ = """HellSpy.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_INFO_PATTERN = '(?P[0-9.]+) (?P[kKMG])i?B\s*

(?P[^<]+)

' + FILE_INFO_PATTERN = '(?P[0-9.]+) (?P[kKMG])i?B\s*

(404 - Page|File) not found

' FILE_URL_REPLACEMENTS = [(r"http://(?:\w*\.)*hellspy\.(?:cz|com|sk|hu)(/\S+/\d+)/?.*", r"http://www.hellspy.com\1")] -- cgit v1.2.3 From b65c4091d5c5e793d8a9df17a46657d45c3a1292 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Mon, 24 Sep 2012 23:54:50 +0200 Subject: multihosters - closed #618, store http/ftp accounts, add uptobox.com premium --- module/plugins/hoster/BasePlugin.py | 58 +++++++++++++++++------------ module/plugins/hoster/Ftp.py | 73 +++++++++++++++++++++++++++++++------ module/plugins/hoster/UptoboxCom.py | 20 ++++++++++ 3 files changed, 116 insertions(+), 35 deletions(-) create mode 100644 module/plugins/hoster/UptoboxCom.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 1ac33931f..14dfbba62 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -12,10 +12,10 @@ class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.151" + __version__ = "0.16" __description__ = """Base Plugin when any other didnt fit""" - __author_name__ = ("RaNaN", 'hagg') - __author_mail__ = ("RaNaN@pyload.org", '') + __author_name__ = ("RaNaN") + __author_mail__ = ("RaNaN@pyload.org") def setup(self): self.chunkLimit = -1 @@ -47,15 +47,22 @@ class BasePlugin(Hoster): except BadHeader, e: if e.code in (401, 403): self.logDebug("Auth required") - - pwd = pyfile.package().password.strip() - if ":" not in pwd: - self.fail(_("Authorization required (username:password)")) - - self.req.addAuth(pwd) + + servers = [ x['login'] for x in core.accountManager.getAccountPlugin('Http').getAllAccounts() ] + server = urlparse(pyfile.url).netloc + + if server in servers: + self.logDebug("Logging on to %s" % server) + self.req.addAuth(self.account.accounts[server]["password"]) + else: + for pwd in pyfile.package().password.splitlines() + if ":" in pwd: + self.req.addAuth(pwd.strip()) + break + else: + self.fail(_("Authorization required (username:password)")) + self.downloadFile(pyfile) - elif e.code == 404: - self.offline() else: raise @@ -64,18 +71,21 @@ class BasePlugin(Hoster): def downloadFile(self, pyfile): - header = self.load(pyfile.url, just_header = True) - #self.logDebug(header) - - # self.load does not raise a BadHeader on 404 responses, do it here - if header.has_key('code') and header['code'] == 404: - raise BadHeader(404) - - if 'location' in header: - self.logDebug("Location: " + header['location']) - url = unquote(header['location']) - else: - url = pyfile.url + url = pyfile.url + + for i in range(5): + header = self.load(pyfile.url, just_header = True) + + # self.load does not raise a BadHeader on 404 responses, do it here + if header.has_key('code') and header['code'] == 404: + raise BadHeader(404) + + if 'location' in header: + self.logDebug("Location: " + header['location']) + url = unquote(header['location']) + self.logDebug("URL: %s" % url, html_unescape(unquote(urlparse(url).path.split("/")[-1]))) + else: + break name = html_unescape(unquote(urlparse(url).path.split("/")[-1])) @@ -92,4 +102,4 @@ class BasePlugin(Hoster): if not name: name = url pyfile.name = name self.logDebug("Filename: %s" % pyfile.name) - self.download(url, disposition=True) + self.download(url, disposition=True) \ No newline at end of file diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 7c2af85ed..3bda3b32e 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -17,24 +17,75 @@ @author: jeix @author: mkaay """ +from urlparse import urlparse, urljoin +from urllib import quote, unquote +import pycurl, re from module.plugins.Hoster import Hoster - +from module.network.HTTPRequest import BadHeader class Ftp(Hoster): __name__ = "Ftp" - __version__ = "0.31" + __version__ = "0.41" __pattern__ = r'(ftps?|sftp)://(.*?:.*?@)?.*?/.*' # ftp://user:password@ftp.server.org/path/to/file __type__ = "hoster" __description__ = """A Plugin that allows you to download from an from an ftp directory""" - __author_name__ = ("jeix", "mkaay") - __author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de") + __author_name__ = ("jeix", "mkaay", "zoidberg") + __author_mail__ = ("jeix@hasnomail.com", "mkaay@mkaay.de", "zoidberg@mujmail.cz") - def process(self, pyfile): - pyfile.name = self.pyfile.url.rpartition('/')[2] - + def setup(self): self.chunkLimit = -1 - self.resumeDownload = True - - self.download(pyfile.url) - + self.resumeDownload = True + + def process(self, pyfile): + parsed_url = urlparse(pyfile.url) + netloc = parsed_url.netloc + + pyfile.name = parsed_url.path.rpartition('/')[2] + try: + pyfile.name = unquote(str(pyfile.name)).decode('utf8') + except: + pass + + if not "@" in netloc: + servers = [ x['login'] for x in self.account.getAllAccounts() ] if self.account else [] + + if netloc in servers: + self.logDebug("Logging on to %s" % netloc) + self.req.addAuth(self.account.accounts[netloc]["password"]) + else: + for pwd in pyfile.package().password.splitlines(): + if ":" in pwd: + self.req.addAuth(pwd.strip()) + break + + self.req.http.c.setopt(pycurl.NOBODY, 1) + + try: + response = self.load(pyfile.url) + except pycurl.error, e: + self.fail("Error %d: %s" % e.args) + + self.req.http.c.setopt(pycurl.NOBODY, 0) + self.logDebug(self.req.http.header) + + found = re.search(r"Content-Length:\s*(\d+)", response) + if found: + pyfile.size = int(found.group(1)) + self.download(pyfile.url) + else: + #Naive ftp directory listing + if re.search(r'^25\d.*?"', self.req.http.header, re.M): + pyfile.url = pyfile.url.rstrip('/') + pkgname = "/".join((pyfile.package().name,urlparse(pyfile.url).path.rpartition('/')[2])) + pyfile.url += '/' + self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY + response = self.load(pyfile.url, decode = False) + links = [ pyfile.url + quote(x) for x in response.splitlines() ] + self.logDebug("LINKS", links) + self.core.api.addPackage(pkgname, links, 1) + #self.core.files.addLinks(links, pyfile.package().id) + else: + self.fail("Unexpected server response") + + \ No newline at end of file diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py new file mode 100644 index 000000000..ae2f14a14 --- /dev/null +++ b/module/plugins/hoster/UptoboxCom.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + +class UptoboxCom(XFileSharingPro): + __name__ = "UptoboxCom" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)*?uptobox.com/\w{12}" + __version__ = "0.06" + __description__ = """Uptobox.com hoster plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FILE_INFO_PATTERN = r'

\s*Download File\s*]*>(?P[^>]+)

\s*[^\(]*\((?P[^\)]+)\)' + HOSTER_NAME = "uptobox.com" + + def setup(self): + self.resumeDownload = self.multiDL = self.premium + self.chunkLimit = 1 + +getInfo = create_getInfo(UptoboxCom) \ No newline at end of file -- cgit v1.2.3 From 233bf90feb2941ecacee56966fdee2cd2f65d7b2 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 25 Sep 2012 19:07:51 +0200 Subject: small plugin fixes --- module/plugins/hoster/BasePlugin.py | 5 ++--- module/plugins/hoster/CzshareCom.py | 4 ++-- module/plugins/hoster/HellshareCz.py | 4 ++-- module/plugins/hoster/RyushareCom.py | 4 ++-- module/plugins/hoster/UptoboxCom.py | 1 + 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 14dfbba62..7d6990c8b 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -55,7 +55,7 @@ class BasePlugin(Hoster): self.logDebug("Logging on to %s" % server) self.req.addAuth(self.account.accounts[server]["password"]) else: - for pwd in pyfile.package().password.splitlines() + for pwd in pyfile.package().password.splitlines(): if ":" in pwd: self.req.addAuth(pwd.strip()) break @@ -74,7 +74,7 @@ class BasePlugin(Hoster): url = pyfile.url for i in range(5): - header = self.load(pyfile.url, just_header = True) + header = self.load(url, just_header = True) # self.load does not raise a BadHeader on 404 responses, do it here if header.has_key('code') and header['code'] == 404: @@ -83,7 +83,6 @@ class BasePlugin(Hoster): if 'location' in header: self.logDebug("Location: " + header['location']) url = unquote(header['location']) - self.logDebug("URL: %s" % url, html_unescape(unquote(urlparse(url).path.split("/")[-1]))) else: break diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 538e3ed86..356771ce4 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -17,7 +17,7 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo, PluginParseError from module.network.RequestFactory import getURL def toInfoPage(url): @@ -45,7 +45,7 @@ class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*czshare\.(com|cz)/(\d+/|download.php\?).*" - __version__ = "0.88" + __version__ = "0.89" __description__ = """CZshare.com""" __author_name__ = ("zoidberg") diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index 9b50f55dc..9130cd797 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -25,8 +25,8 @@ from module.network.RequestFactory import getURL class HellshareCz(SimpleHoster): __name__ = "HellshareCz" __type__ = "hoster" - __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu)/[^?]*/\d+).*" - __version__ = "0.78" + __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu|pl)/[^?]*/\d+).*" + __version__ = "0.79" __description__ = """Hellshare.cz""" __author_name__ = ("zoidberg") diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index b3d7bafc6..9bbbdcb91 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -4,8 +4,8 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf class RyushareCom(XFileSharingPro): __name__ = "RyushareCom" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{12}" - __version__ = "0.02" + __pattern__ = r"http://(?:\w*\.)*?ryushare.com/\w{11,}" + __version__ = "0.03" __description__ = """ryushare.com hoster plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index ae2f14a14..60a93c1e5 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -11,6 +11,7 @@ class UptoboxCom(XFileSharingPro): __author_mail__ = ("zoidberg@mujmail.cz") FILE_INFO_PATTERN = r'

\s*Download File\s*]*>(?P[^>]+)

\s*[^\(]*\((?P[^\)]+)\)' + FILE_OFFLINE_PATTERN = r'
File Not Found
' HOSTER_NAME = "uptobox.com" def setup(self): -- cgit v1.2.3 From fc3d05bfc4f026efbdc0e9299a2fcbb463397f78 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 25 Sep 2012 23:21:23 +0200 Subject: filebeer.info (free only) - closed #687 --- module/plugins/hoster/FilebeerInfo.py | 88 +++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 module/plugins/hoster/FilebeerInfo.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/FilebeerInfo.py b/module/plugins/hoster/FilebeerInfo.py new file mode 100644 index 000000000..d7d3640a8 --- /dev/null +++ b/module/plugins/hoster/FilebeerInfo.py @@ -0,0 +1,88 @@ +# -*- 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, create_getInfo +from module.plugins.ReCaptcha import ReCaptcha +from pycurl import FOLLOWLOCATION + +class FilebeerInfo(SimpleHoster): + __name__ = "FilebeerInfo" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)?filebeer\.info/(?!\d*~f)\w+" + __version__ = "0.01" + __description__ = """Filebeer.info plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FILE_INFO_PATTERN = r'\s*(?P.+?) \((?P[0-9.]+) (?P[kKMG])i?B\)(
\s*)?
' + FILE_OFFLINE_PATTERN = r'Upload Files - FileBeer.info' + + RECAPTCHA_KEY_PATTERN = r'http://www.google.com/recaptcha/api/(?:challenge|noscript)?k=(\w+)' + FREE_URL_PATTERN = r"" + WAIT_TIME_PATTERN = r"\(\'\.download-timer-seconds\'\)\.html\((\d+)\)" + + def setup(self): + self.resumeDownload = True + self.multiDL = False + + def handleFree(self): + if not 'id="form-join"' in self.html: + found = re.search(self.FREE_URL_PATTERN, self.html) + url = found.group(1) if found else "%s?d=1" % self.pyfile.url.rstrip('/') + + found = re.search(self.WAIT_TIME_PATTERN, self.html) + self.setWait(int(found.group(1)) if found else 60) + self.wait() + + self.html = self.load(url) + + action, inputs = self.parseHtmlForm('form-join') + if not action: + self.retry(max_tries=5, wait_time=60, reason='Form not found') + + found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) + recaptcha_key = found.group(1) if found else '6LeuAc4SAAAAAOSry8eo2xW64K1sjHEKsQ5CaS10' + + recaptcha = ReCaptcha(self) + for i in range(5): + inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) + + self.req.http.c.setopt(FOLLOWLOCATION, 0) + self.html = self.load(action, post = inputs) + self.header = self.req.http.header + self.req.http.c.setopt(FOLLOWLOCATION, 1) + + found = re.search("Location\s*:\s*(.*)", self.header, re.I) + if found: + download_url = found.group(1).strip() + self.correctCaptcha() + break + elif 'Captcha confirmation text is invalid' in self.html: + self.invalidCaptcha() + else: + self.parseError('download url') + + else: self.fail("No valid captcha solution received") + + self.multiDL = True + + self.req.http.lastURL = action + self.download(download_url) + +getInfo = create_getInfo(FilebeerInfo) \ No newline at end of file -- cgit v1.2.3 From df0b35be0bc0e2b13be8c6787bbce03082f0e08e Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Thu, 27 Sep 2012 20:28:32 +0200 Subject: add filebeer.info/fastshare.cz/quickshare.cz premium, closed #688 --- module/plugins/hoster/CramitIn.py | 4 +- module/plugins/hoster/FastshareCz.py | 20 +++++++- module/plugins/hoster/FilebeerInfo.py | 46 ++++++++++------- module/plugins/hoster/FilerioCom.py | 12 ++--- module/plugins/hoster/QuickshareCz.py | 95 +++++++++++++++++++++++------------ module/plugins/hoster/RarefileNet.py | 6 ++- 6 files changed, 124 insertions(+), 59 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/CramitIn.py b/module/plugins/hoster/CramitIn.py index a7935c744..171fba0ff 100644 --- a/module/plugins/hoster/CramitIn.py +++ b/module/plugins/hoster/CramitIn.py @@ -5,7 +5,7 @@ class CramitIn(XFileSharingPro): __name__ = "CramitIn" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*cramit.in/\w{12}" - __version__ = "0.03" + __version__ = "0.04" __description__ = """Cramit.in hoster plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -15,6 +15,6 @@ class CramitIn(XFileSharingPro): HOSTER_NAME = "cramit.in" def setup(self): - self.multiDL = self.premium + self.resumeDownload = self.multiDL = self.premium getInfo = create_getInfo(CramitIn) \ No newline at end of file diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 654a1abe8..d71684166 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -23,7 +23,7 @@ class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?fastshare.cz/\d+/.+" - __version__ = "0.12" + __version__ = "0.13" __description__ = """FastShare.cz""" __author_name__ = ("zoidberg") @@ -31,8 +31,11 @@ class FastshareCz(SimpleHoster): FILE_SIZE_PATTERN = r'Velikost: (?P[^<]+)' FILE_OFFLINE_PATTERN = r'
\s*
Stáhnout FREE.*?' + PREMIUM_URL_PATTERN = r'(http://data\d+\.fastshare\.cz/download\.php\?id=\d+\&[^\s\"\'<>]+)' + NOT_ENOUGH_CREDIC_PATTERN = "Nem.te dostate.n. kredit pro sta.en. tohoto souboru" def handleFree(self): found = re.search(self.FREE_URL_PATTERN, self.html) @@ -49,4 +52,19 @@ class FastshareCz(SimpleHoster): self.wait() self.retry() + def handlePremium(self): + if self.NOT_ENOUGH_CREDIC_PATTERN in self.html: + self.logWarning('Not enough traffic left') + self.resetAccount() + + found = re.search(self.PREMIUM_URL_PATTERN, self.html) + if not found: self.parseError("Premium URL") + url = found.group(1) + self.logDebug("PREMIUM URL: %s" % url) + self.download(url) + + check = self.checkDownload({"credit": re.compile(self.NOT_ENOUGH_CREDIC_PATTERN)}) + if check == "credit": + self.resetAccount() + getInfo = create_getInfo(FastshareCz) \ No newline at end of file diff --git a/module/plugins/hoster/FilebeerInfo.py b/module/plugins/hoster/FilebeerInfo.py index d7d3640a8..a51f70a09 100644 --- a/module/plugins/hoster/FilebeerInfo.py +++ b/module/plugins/hoster/FilebeerInfo.py @@ -24,37 +24,42 @@ from pycurl import FOLLOWLOCATION class FilebeerInfo(SimpleHoster): __name__ = "FilebeerInfo" __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?filebeer\.info/(?!\d*~f)\w+" - __version__ = "0.01" + __pattern__ = r"http://(?:www\.)?filebeer\.info/(?!\d*~f)(?P\w+).*" + __version__ = "0.02" __description__ = """Filebeer.info plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") + FILE_NAME_PATTERN = r'Filename:\s*\s*\s*(?P.+?)  ' + FILE_SIZE_PATTERN = r'Filesize:\s*\s*\s*(?P[0-9.]+) (?P[kKMG])i?B' FILE_INFO_PATTERN = r'\s*(?P.+?) \((?P[0-9.]+) (?P[kKMG])i?B\)(
\s*)?
' FILE_OFFLINE_PATTERN = r'Upload Files - FileBeer.info' + FILE_URL_REPLACEMENTS = [(__pattern__, 'http://filebeer.info/\g~i')] + RECAPTCHA_KEY_PATTERN = r'http://www.google.com/recaptcha/api/(?:challenge|noscript)?k=(\w+)' - FREE_URL_PATTERN = r"
" + DOWNLOAD_URL_PATTERN = r"\[url\](.+?)\[/url\]" WAIT_TIME_PATTERN = r"\(\'\.download-timer-seconds\'\)\.html\((\d+)\)" def setup(self): self.resumeDownload = True - self.multiDL = False - - def handleFree(self): - if not 'id="form-join"' in self.html: - found = re.search(self.FREE_URL_PATTERN, self.html) - url = found.group(1) if found else "%s?d=1" % self.pyfile.url.rstrip('/') - - found = re.search(self.WAIT_TIME_PATTERN, self.html) - self.setWait(int(found.group(1)) if found else 60) - self.wait() - - self.html = self.load(url) + self.multiDL = self.premium + def handleFree(self): + url = self.getDownloadUrl() + + for i in range(5): + self.html = self.load(url) + if i == 4 or 'id="form-join"' in self.html: + break + else: + found = re.search(self.WAIT_TIME_PATTERN, self.html) + self.setWait(int(found.group(1)) +1 if found else 61) + self.wait() + action, inputs = self.parseHtmlForm('form-join') if not action: - self.retry(max_tries=5, wait_time=60, reason='Form not found') + self.fail('Form not found') found = re.search(self.RECAPTCHA_KEY_PATTERN, self.html) recaptcha_key = found.group(1) if found else '6LeuAc4SAAAAAOSry8eo2xW64K1sjHEKsQ5CaS10' @@ -83,6 +88,13 @@ class FilebeerInfo(SimpleHoster): self.multiDL = True self.req.http.lastURL = action - self.download(download_url) + self.download(download_url) + + def handlePremium(self): + self.download(self.getDownloadUrl()) + + def getDownloadUrl(self): + found = re.search(self.DOWNLOAD_URL_PATTERN, self.html) + return ("%s?d=1" % found.group(1)) if found else ("http://filebeer.info/%s?d=1" % self.file_info['ID']) getInfo = create_getInfo(FilebeerInfo) \ No newline at end of file diff --git a/module/plugins/hoster/FilerioCom.py b/module/plugins/hoster/FilerioCom.py index 3d983bedf..7be0fa4f6 100644 --- a/module/plugins/hoster/FilerioCom.py +++ b/module/plugins/hoster/FilerioCom.py @@ -4,17 +4,17 @@ from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInf class FilerioCom(XFileSharingPro): __name__ = "FilerioCom" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)*file(rio|keen).com/\w{12}" - __version__ = "0.01" - __description__ = """FileRio.com hoster plugin""" + __pattern__ = r"http://(?:\w*\.)*(filerio\.(in|com)|filekeen\.com)/\w{12}" + __version__ = "0.02" + __description__ = """FileRio.in hoster plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") FILE_OFFLINE_PATTERN = '"File Not Found"|File has been removed due to Copyright Claim' - HOSTER_NAME = "filerio.com" - DIRECT_LINK_PATTERN = r'Download Link:.*?location.href=\'/chyba\';' FILE_NAME_PATTERN = r'Název:\s*(?P[^<]+)' FILE_SIZE_PATTERN = r'Velikost:\s*(?P[0-9.]+) (?P[kKMG])i?B' - - def setup(self): - self.multiDL = False + FILE_OFFLINE_PATTERN = r'' def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) + self.html = self.load(pyfile.url, decode = True) self.getFileInfo() - - # parse the name from the site and set attribute in pyfile - parsed_vars = re.search(self.VAR_PATTERN, self.html) - if parsed_vars is None: self.parseError("VARs") - pyfile.name = parsed_vars.group('ID3') - - # download the file, destination is determined by pyLoad - download_url = parsed_vars.group('Server') + "/download.php" - self.log.debug("File:" + pyfile.name) - self.log.debug("URL:" + download_url) - - self.download(download_url, post={ - "ID1": parsed_vars.group('ID1'), - "ID2": parsed_vars.group('ID2'), - "ID3": parsed_vars.group('ID3'), - "ID4": parsed_vars.group('ID4') - }) - - # check download - check = self.checkDownload({ - "no_slots": "obsazen na 100 %" - }) + # parse js variables + self.jsvars = dict((x, y.strip("'")) for x,y in re.findall(r"var (\w+) = ([0-9.]+|'[^']*')", self.html)) + self.logDebug(self.jsvars) + pyfile.name = self.jsvars['ID3'] + + # determine download type - free or premium + if self.premium: + if 'UU_prihlasen' in self.jsvars: + if self.jsvars['UU_prihlasen'] == '0': + self.logWarning('User not logged in') + self.relogin(user) + self.retry() + elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']): + self.logWarning('Not enough credit left') + self.premium = False + + if self.premium: + self.handlePremium() + else: + self.handleFree() + + check = self.checkDownload({"err": re.compile(r"\AChyba!")}, max_size=100) + if check == "err": + self.fail("File not found or plugin defect") + + def handleFree(self): + # get download url + download_url = '%s/download.php' % self.jsvars['server'] + data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID3', 'ID4')) + self.logDebug("FREE URL1:" + download_url, data) + + self.req.http.c.setopt(FOLLOWLOCATION, 0) + self.load(download_url, post=data) + self.header = self.req.http.header + self.req.http.c.setopt(FOLLOWLOCATION, 1) + + found = re.search("Location\s*:\s*(.*)", self.header, re.I) + if not found: self.fail('File not found') + download_url = found.group(1) + self.logDebug("FREE URL2:" + download_url) + + # check errors + found = re.search(r'/chyba/(\d+)', download_url) + if found: + if found.group(1) == '1': + self.retry(max_tries=60, wait_time=120, reason="This IP is already downloading") + elif found.group(1) == '2': + self.retry(max_tries=60, wait_time=60, reason="No free slots available") + else: + self.fail('Error %d' % found.group(1)) - if check == "no_slots": - self.retry(5, 600, "No free slots") + # download file + self.download(download_url) + + def handlePremium(self): + download_url = '%s/download_premium.php' % self.jsvars['server'] + data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ('ID1', 'ID2', 'ID4', 'ID5')) + self.logDebug("PREMIUM URL:" + download_url, data) + self.download(download_url, get=data) -create_getInfo(QuickshareCz) \ No newline at end of file +getInfo = create_getInfo(QuickshareCz) \ No newline at end of file diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py index 8339d40eb..7c5543cc8 100644 --- a/module/plugins/hoster/RarefileNet.py +++ b/module/plugins/hoster/RarefileNet.py @@ -7,13 +7,17 @@ class RarefileNet(XFileSharingPro): __name__ = "RarefileNet" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*rarefile.net/\w{12}" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Rarefile.net hoster plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") FILE_NAME_PATTERN = r'(?P.*?)' FILE_SIZE_PATTERN = r'Size : (?P.+?) ' + HOSTER_NAME = "rarefile.net" + + def setup(self): + self.resumeDownload = self.multiDL = self.premium def handleCaptcha(self, inputs): captcha_div = re.search(r'Enter code.*?(.*?)
', self.html, re.S).group(1) -- cgit v1.2.3 From a7c0c364ee90285fe5c2311a8a247f4c55eccd57 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Thu, 27 Sep 2012 21:14:10 +0200 Subject: update hellshare.cz --- module/plugins/hoster/HellshareCz.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py index 9130cd797..15d00be70 100644 --- a/module/plugins/hoster/HellshareCz.py +++ b/module/plugins/hoster/HellshareCz.py @@ -26,7 +26,7 @@ class HellshareCz(SimpleHoster): __name__ = "HellshareCz" __type__ = "hoster" __pattern__ = r"(http://(?:.*\.)*hellshare\.(?:cz|com|sk|hu|pl)/[^?]*/\d+).*" - __version__ = "0.79" + __version__ = "0.80" __description__ = """Hellshare.cz""" __author_name__ = ("zoidberg") @@ -37,7 +37,7 @@ class HellshareCz(SimpleHoster): FILE_OFFLINE_PATTERN = r'

File not found.

' CAPTCHA_PATTERN = r'' #FILE_CREDITS_PATTERN = r'(\d+) MB' - CREDIT_LEFT_PATTERN = r'

After downloading this file you will have (\d+) MB for future downloads.' + CREDIT_LEFT_PATTERN = r'(\d+)credits' DOWNLOAD_AGAIN_PATTERN = r'

This file you downloaded already and re-download is for free.

' SHOW_WINDOW_PATTERN = r'
Date: Mon, 1 Oct 2012 23:52:18 +0200 Subject: rapidgator.net premium, novafile.com free, multihoster schedule refresh --- module/plugins/hoster/CzshareCom.py | 5 +- module/plugins/hoster/EuroshareEu.py | 48 ++++++------------- module/plugins/hoster/NovafileCom.py | 24 ++++++++++ module/plugins/hoster/RapidgatorNet.py | 81 +++++++++++++++----------------- module/plugins/hoster/XFileSharingPro.py | 11 +++-- 5 files changed, 86 insertions(+), 83 deletions(-) create mode 100644 module/plugins/hoster/NovafileCom.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 356771ce4..8d035b64c 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -45,7 +45,7 @@ class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*czshare\.(com|cz)/(\d+/|download.php\?).*" - __version__ = "0.89" + __version__ = "0.90" __description__ = """CZshare.com""" __author_name__ = ("zoidberg") @@ -142,6 +142,9 @@ class CzshareCom(SimpleHoster): self.html = self.load(parsed_url, cookies=True, post=inputs) + if re.search(self.MULTIDL_PATTERN, self.html): + self.waitForFreeSlot() + found = re.search("countdown_number = (\d+);", self.html) self.setWait(int(found.group(1)) if found else 50) diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index a0bfe0ab2..2c356f02a 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -17,51 +17,31 @@ """ import re -from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL +from module.plugins.internal.SimpleHoster import SimpleHoster -def getInfo(urls): - result = [] - - for url in urls: - - html = getURL(url, decode=True) - if re.search(EuroshareEu.FILE_OFFLINE_PATTERN, html): - # File offline - result.append((url, 0, 1, url)) - else: - result.append((url, 0, 2, url)) - yield result - -class EuroshareEu(Hoster): +class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" - __pattern__ = r"http://(\w*\.)?euroshare.eu/file/.*" - __version__ = "0.2b" + __pattern__ = r"http://(\w*\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*" + __version__ = "0.21" __description__ = """Euroshare.eu""" __author_name__ = ("zoidberg") - URL_PATTERN = r'' - FILE_OFFLINE_PATTERN = r'

S.bor sa nena.iel

' - ERR_PARDL_PATTERN = r'

Prebieha s.ahovanie

' - - def setup(self): - self.multiDL = False - - def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - - if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: - self.offline() + FILE_INFO_PATTERN = r'(?P.+?) \((?P.+?)\)' + FILE_OFFLINE_PATTERN = ur'

S.bor sa nena.iel

|Požadovaná stránka neexistuje!' + + FREE_URL_PATTERN = r'
Prebieha s.ahovanie' + def handleFree(self): if re.search(self.ERR_PARDL_PATTERN, self.html) is not None: self.waitForFreeSlot() - found = re.search(self.URL_PATTERN, self.html) + found = re.search(self.FREE_URL_PATTERN, self.html) if found is None: - self.fail("Parse error (URL)") - parsed_url = found.group(1) - + self.parseError("Parse error (URL)") + parsed_url = "http://euroshare.eu%s" % found.group(1) + self.logDebug("URL", parsed_url) self.download(parsed_url, disposition=True) def waitForFreeSlot(self): diff --git a/module/plugins/hoster/NovafileCom.py b/module/plugins/hoster/NovafileCom.py new file mode 100644 index 000000000..dfd18761c --- /dev/null +++ b/module/plugins/hoster/NovafileCom.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo + +class NovafileCom(XFileSharingPro): + __name__ = "NovafileCom" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)*novafile\.com/\w{12}" + __version__ = "0.01" + __description__ = """novafile.com hoster plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FILE_SIZE_PATTERN = r'
(?P.+?)
' + #FILE_OFFLINE_PATTERN = '"File Not Found"|File has been removed due to Copyright Claim' + FORM_PATTERN = r'name="F\d+"' + ERROR_PATTERN = r'class="alert[^"]*alert-separate"[^>]*>\s*(?:

)?(.*?)\s*Download File' + + HOSTER_NAME = "novafile.com" + + def setup(self): + self.multiDL = False + +getInfo = create_getInfo(NovafileCom) \ No newline at end of file diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 678a3d707..291ba4c4b 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -21,55 +21,18 @@ from pycurl import HTTPHEADER from random import random from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.CaptchaServices import ReCaptcha, SolveMedia, AdsCaptcha from module.common.json_layer import json_loads -from module.plugins.ReCaptcha import ReCaptcha - -class AdsCaptcha(): - def __init__(self, plugin): - self.plugin = plugin - - def challenge(self, src): - js = self.plugin.req.load(src, cookies=True) - - try: - challenge = re.search("challenge: '(.*?)',", js).group(1) - server = re.search("server: '(.*?)',", js).group(1) - except: - self.plugin.fail("adscaptcha error") - result = self.result(server,challenge) - - return challenge, result - - def result(self, server, challenge): - return self.plugin.decryptCaptcha("%sChallenge.aspx" % server, get={"cid": challenge, "dummy": random()}, cookies=True, imgtype="jpg") - -class SolveMedia(): - def __init__(self,plugin): - self.plugin = plugin - - def challenge(self, src): - html = self.plugin.req.load("http://api.solvemedia.com/papi/challenge.script?k=%s" % src, cookies=True) - try: - ckey = re.search("ckey:.*?'(.*?)',",html).group(1) - html = self.plugin.req.load("http://api.solvemedia.com/papi/_challenge.js?k=%s" % ckey, cookies=True) - challenge = re.search('"chid".*?: "(.*?)"',html).group(1) - except: - self.plugin.fail("solvmedia error") - result = self.result(challenge) - - return challenge, result - - def result(self,challenge): - return self.plugin.decryptCaptcha("http://api.solvemedia.com/papi/media?c=%s" % challenge,imgtype="gif") - class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)" - __version__ = "0.06" + __version__ = "0.08" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg","chrox") + + API_URL = 'http://test.rapidgator.net/api/file' FILE_INFO_PATTERN = r'Downloading:(\s*<[^>]*>)*\s*(?P.*?)(\s*<[^>]*>)*\s*File size:\s*(?P.*?)' FILE_OFFLINE_PATTERN = r'File not found' @@ -79,6 +42,39 @@ class RapidgatorNet(SimpleHoster): RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"' ADSCAPTCHA_SRC_PATTERN = r'(http://api.adscaptcha.com/Get.aspx[^"\']*)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' + + def process(self, pyfile): + self.pyfile = pyfile + if self.premium: + self.handlePremium() + else: + self.fail("NO FREE") + + def getAPIResponse(self, cmd): + json = self.load('%s/%s' % (self.API_URL, cmd), + get = {'sid': self.account.getAccountData(self.user).get('SID'), + 'url': self.pyfile.url}) + self.logDebug('API:%s' % cmd, json) + json = json_loads(json) + + status = json['response_status'] + if status == 200: + return json['response'] + elif status == 401: + self.account.relogin(self.user) + self.retry() + elif status == 423: + self.account.empty(self.user) + self.retry() + else: + self.fail(json['response_details']) + + def handlePremium(self): + self.api_data = self.getAPIResponse('info') + self.pyfile.name = self.api_data['filename'] + self.pyfile.size = self.api_data['size'] + url = self.getAPIResponse('download')['url'] + self.download(url) def handleFree(self): if "You can download files up to 500 MB in free mode" in self.html \ @@ -177,5 +173,4 @@ class RapidgatorNet(SimpleHoster): self.logDebug(url, response) return json_loads(response) -getInfo = create_getInfo(RapidgatorNet) - +getInfo = create_getInfo(RapidgatorNet) \ No newline at end of file diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 8e213e9bf..ef559a56f 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -34,7 +34,7 @@ class XFileSharingPro(SimpleHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.11" + __version__ = "0.12" __description__ = """XFileSharingPro common hoster base""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -51,7 +51,8 @@ class XFileSharingPro(SimpleHoster): CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"' CAPTCHA_DIV_PATTERN = r'Enter code.*?(.*?)

' - ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)]*>(.*?) Date: Wed, 3 Oct 2012 01:14:48 +0200 Subject: update czshare, little fixes --- module/plugins/hoster/CzshareCom.py | 106 +++++++++++++-------------------- module/plugins/hoster/LoadTo.py | 7 ++- module/plugins/hoster/RapidgatorNet.py | 11 +--- 3 files changed, 46 insertions(+), 78 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py index 8d035b64c..c8a576b29 100644 --- a/module/plugins/hoster/CzshareCom.py +++ b/module/plugins/hoster/CzshareCom.py @@ -17,42 +17,24 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo, PluginParseError -from module.network.RequestFactory import getURL - -def toInfoPage(url): - if r"/download.php?" in url: - try: - id = re.search(r"id=(\d+)", url).group(1) - code = re.search(r"code=(\w+)", url).group(1) - except Exception, e: - return None - return "http://czshare.com/%s/%s/" % (id, code) - return url - -def getInfo(urls): - result = [] - - for url in urls: - info_url = toInfoPage(url) - if info_url: - file_info = parseFileInfo(CzshareCom, url, getURL(info_url, decode=True)) - result.append(file_info) - - yield result +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.utils import parseFileSize class CzshareCom(SimpleHoster): __name__ = "CzshareCom" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*czshare\.(com|cz)/(\d+/|download.php\?).*" - __version__ = "0.90" + __version__ = "0.91" __description__ = """CZshare.com""" __author_name__ = ("zoidberg") FILE_NAME_PATTERN = r'
\s*

\s*Cel. n.zev: ]*>(?P[^<]+)' FILE_SIZE_PATTERN = r'

(?:\s*

[^\n]*

)*\s*Velikost:\s*(?P[0-9., ]+)(?P[kKMG])i?B\s*
' FILE_OFFLINE_PATTERN = r'
\s*

' + FILE_SIZE_REPLACEMENTS = [(' ', '')] + FILE_URL_REPLACEMENTS = [(r'http://[^/]*/download.php\?.*?id=(\w+).*', r'http://czshare.com/\1/x/')] + SH_CHECK_TRAFFIC = True FREE_URL_PATTERN = r'[^>]*alt="([^"]+)" />' FREE_FORM_PATTERN = r'
\s*(.*?)
' @@ -65,20 +47,7 @@ class CzshareCom(SimpleHoster): self.multiDL = self.resumeDownload = True if self.premium else False self.chunkLimit = 1 - def process(self, pyfile): - url = toInfoPage(pyfile.url) - if not url: - self.logError(e) - self.fail("Invalid URL") - - self.html = self.load(url, cookies=True, decode=True) - self.getFileInfo() - - if not self.account or not self.handlePremium(): - self.handleFree() - self.checkDownloadedFile() - - def handlePremium(self): + def checkTrafficLeft(self): # check if user logged in found = re.search(self.USER_CREDIT_PATTERN, self.html) if not found: @@ -89,17 +58,19 @@ class CzshareCom(SimpleHoster): # check user credit try: - credit = float(found.group(1).replace(',','.').replace(' ','')) - credit = credit * 1024 ** {'KB': 0, 'MB': 1, 'GB': 2}[found.group(2)] + credit = parseFileSize(found.group(1).replace(' ',''), found.group(2)) self.logInfo("Premium download for %i KiB of Credit" % (self.pyfile.size / 1024)) - self.logInfo("User %s has %i KiB left" % (self.user, credit)) - if credit * 1024 < self.pyfile.size: + self.logInfo("User %s has %i KiB left" % (self.user, credit / 1024)) + if credit < self.pyfile.size: self.logInfo("Not enough credit to download file %s" % self.pyfile.name) - self.resetAccount() + return False except Exception, e: # let's continue and see what happens... self.logError('Parse error (CREDIT): %s' % e) - + + return True + + def handlePremium(self): # parse download link try: form = re.search(self.PREMIUM_FORM_PATTERN, self.html, re.DOTALL).group(1) @@ -110,7 +81,7 @@ class CzshareCom(SimpleHoster): # download the file, destination is determined by pyLoad self.download("http://czshare.com/profi_down.php", cookies=True, post=inputs) - return True + self.checkDownloadedFile() def handleFree(self): # get free url @@ -121,11 +92,9 @@ class CzshareCom(SimpleHoster): self.logDebug("PARSED_URL:" + parsed_url) # get download ticket and parse html - self.html = self.load(parsed_url, cookies=True) - - #if not re.search(self.FREE_FORM_PATTERN, self.html): + self.html = self.load(parsed_url, cookies=True, decode=True) if re.search(self.MULTIDL_PATTERN, self.html): - self.waitForFreeSlot() + self.longWait(300, 12) try: form = re.search(self.FREE_FORM_PATTERN, self.html, re.DOTALL).group(1) @@ -135,15 +104,20 @@ class CzshareCom(SimpleHoster): self.logError(e) raise PluginParseError('Form') - # get and decrypt captcha + # get and decrypt captcha captcha_url = 'http://czshare.com/captcha.php' - inputs['captchastring2'] = self.decryptCaptcha(captcha_url) - self.logDebug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + inputs['captchastring2']) - - self.html = self.load(parsed_url, cookies=True, post=inputs) - - if re.search(self.MULTIDL_PATTERN, self.html): - self.waitForFreeSlot() + for i in range(5): + inputs['captchastring2'] = self.decryptCaptcha(captcha_url) + self.html = self.load(parsed_url, cookies=True, post=inputs, decode=True) + if u"
  • Zadaný ověřovací kód nesouhlasí!
  • " in self.html: + self.invalidCaptcha() + elif re.search(self.MULTIDL_PATTERN, self.html): + self.longWait(300, 12) + else: + self.correctCaptcha() + break + else: + self.fail("No valid captcha code entered") found = re.search("countdown_number = (\d+);", self.html) self.setWait(int(found.group(1)) if found else 50) @@ -158,26 +132,26 @@ class CzshareCom(SimpleHoster): self.wait() self.multiDL = True - self.download(url) + self.download(url) + self.checkDownloadedFile() def checkDownloadedFile(self): # check download check = self.checkDownload({ - "tempoffline": re.compile(r"^Soubor je do.asn. nedostupn.$"), + "tempoffline": re.compile(r"^Soubor je do.*asn.* nedostupn.*$"), + "credit": re.compile(r"^Nem.*te dostate.*n.* kredit.$"), "multi_dl": re.compile(self.MULTIDL_PATTERN), "captcha_err": "
  • Zadaný ověřovací kód nesouhlasí!
  • " }) if check == "tempoffline": self.fail("File not available - try later") + if check == "credit": + self.resetAccount() elif check == "multi_dl": - self.waitForFreeSlot() + self.longWait(300, 12) elif check == "captcha_err": self.invalidCaptcha() self.retry() - - def waitForFreeSlot(self, wait_time = 300): - self.multiDL = False - self.setWait(wait_time, True) - self.wait() - self.retry() \ No newline at end of file + +getInfo = create_getInfo(CzshareCom) \ No newline at end of file diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 66bc6f407..babf354a9 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- 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 @@ -43,7 +43,7 @@ class LoadTo(Hoster): __name__ = "LoadTo" __type__ = "hoster" __pattern__ = r"http://(www.*?\.)?load\.to/.{7,10}?/.*" - __version__ = "0.1002" + __version__ = "0.11" __description__ = """load.to""" __author_name__ = ("halfman") __author_mail__ = ("Pulpan3@gmail.com") @@ -79,4 +79,5 @@ class LoadTo(Hoster): self.setWait(timmy.group(1)) self.wait() - self.download(download_url) + self.req.setOption("timeout", 120) + self.download(download_url) \ No newline at end of file diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 291ba4c4b..6c09eabb9 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -21,7 +21,7 @@ from pycurl import HTTPHEADER from random import random from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.plugins.internal.CaptchaServices import ReCaptcha, SolveMedia, AdsCaptcha +from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia, AdsCaptcha from module.common.json_layer import json_loads class RapidgatorNet(SimpleHoster): @@ -42,14 +42,7 @@ class RapidgatorNet(SimpleHoster): RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"' ADSCAPTCHA_SRC_PATTERN = r'(http://api.adscaptcha.com/Get.aspx[^"\']*)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' - - def process(self, pyfile): - self.pyfile = pyfile - if self.premium: - self.handlePremium() - else: - self.fail("NO FREE") - + def getAPIResponse(self, cmd): json = self.load('%s/%s' % (self.API_URL, cmd), get = {'sid': self.account.getAccountData(self.user).get('SID'), -- cgit v1.2.3 From 611034705079e9c0e432efbabbadb5a9292a383f Mon Sep 17 00:00:00 2001 From: godofdream Date: Wed, 3 Oct 2012 19:00:25 +0200 Subject: Fix DuckcryptInfo and NowDownloadEu --- module/plugins/hoster/NowDownloadEu.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py index fa699a278..126ca3d89 100644 --- a/module/plugins/hoster/NowDownloadEu.py +++ b/module/plugins/hoster/NowDownloadEu.py @@ -19,12 +19,13 @@ import re from random import random from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.utils import fixup class NowDownloadEu(SimpleHoster): __name__ = "NowDownloadEu" __type__ = "hoster" __pattern__ = r"http://(www\.)?nowdownload\.(eu|co)/dl/(?P[a-z0-9]+)" - __version__ = "0.01" + __version__ = "0.02" __description__ = """NowDownloadEu""" __author_name__ = ("godofdream") FILE_INFO_PATTERN = r'Downloading
    (?P.*) (?P[0-9,.]+) (?P[kKMG])i?B

    ' @@ -33,6 +34,9 @@ class NowDownloadEu(SimpleHoster): FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"' FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),' FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.eu/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"' + + FILE_NAME_REPLACEMENTS = [("&#?\w+;", fixup), (r'<[^>]*>', '')] + def setup(self): self.wantReconnect = False self.multiDL = True @@ -59,4 +63,4 @@ class NowDownloadEu(SimpleHoster): self.logDebug('Download link: ' + str(url.group(1))) self.download(str(url.group(1))) -getInfo = create_getInfo(NowDownloadEu) \ No newline at end of file +getInfo = create_getInfo(NowDownloadEu) -- cgit v1.2.3 From 6f1d49a979b6ab97c82164a0794251f3ed7571d2 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Wed, 3 Oct 2012 22:44:10 +0200 Subject: rapidgator fix api url --- module/plugins/hoster/RapidgatorNet.py | 4 ++-- module/plugins/hoster/WarserverCz.py | 44 ++++++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 6c09eabb9..47ab662d9 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -28,11 +28,11 @@ class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)" - __version__ = "0.08" + __version__ = "0.09" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg","chrox") - API_URL = 'http://test.rapidgator.net/api/file' + API_URL = 'http://rapidgator.net/api/file' FILE_INFO_PATTERN = r'Downloading:(\s*<[^>]*>)*\s*(?P.*?)(\s*<[^>]*>)*\s*File size:\s*(?P.*?)' FILE_OFFLINE_PATTERN = r'File not found' diff --git a/module/plugins/hoster/WarserverCz.py b/module/plugins/hoster/WarserverCz.py index 423170319..b256f8d1b 100644 --- a/module/plugins/hoster/WarserverCz.py +++ b/module/plugins/hoster/WarserverCz.py @@ -16,19 +16,55 @@ @author: zoidberg """ +#similar to coolshare.cz (down) + import re -from module.plugins.hoster.CoolshareCz import CoolshareCz -from module.plugins.internal.SimpleHoster import create_getInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.network.HTTPRequest import BadHeader +from module.utils import html_unescape -class WarserverCz(CoolshareCz): +class WarserverCz(SimpleHoster): __name__ = "WarserverCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?warserver.cz/stahnout/(?P\d+)/.+" - __version__ = "0.11" + __version__ = "0.12" __description__ = """Warserver.cz""" __author_name__ = ("zoidberg") FILE_NAME_PATTERN = r'(?P[^<]+)' + FILE_SIZE_PATTERN = r'
  • Velikost: (?P[^<]+)' + FILE_OFFLINE_PATTERN = r'

    Soubor nenalezen

    ' + + PREMIUM_URL_PATTERN = r'href="(http://[^/]+/dwn-premium.php.*?)"' + DOMAIN = "http://csd01.coolshare.cz" + DOMAIN = "http://s01.warserver.cz" + + def handleFree(self): + try: + self.download("%s/dwn-free.php?fid=%s" % (self.DOMAIN, self.file_info['ID'])) + except BadHeader, e: + self.logError(e) + if e.code == 403: + self.longWait(60,60) + else: raise + self.checkDownloadedFile() + + 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) + self.checkDownloadedFile() + + def checkDownloadedFile(self): + check = self.checkDownload({ + "offline": ">404 Not Found<" + }) + + if check == "offline": + self.offline() getInfo = create_getInfo(WarserverCz) \ No newline at end of file -- cgit v1.2.3 From 9bbdc760ae1f16350a65c76e2614c837ce3dd2e3 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sat, 6 Oct 2012 02:12:20 +0200 Subject: fix rapidgator.net --- module/plugins/hoster/RapidgatorNet.py | 86 +++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 39 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 47ab662d9..ad23b5a33 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -23,77 +23,85 @@ from random import random from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia, AdsCaptcha from module.common.json_layer import json_loads +from module.network.HTTPRequest import BadHeader class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)" - __version__ = "0.09" + __version__ = "0.10" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg","chrox") - + API_URL = 'http://rapidgator.net/api/file' - + FILE_INFO_PATTERN = r'Downloading:(\s*<[^>]*>)*\s*(?P.*?)(\s*<[^>]*>)*\s*File size:\s*(?P.*?)' FILE_OFFLINE_PATTERN = r'File not found' - - JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;" + + JSVARS_PATTERN = r"\s+var\s*(startTimerUrl|getDownloadUrl|captchaUrl|fid|secs)\s*=\s*'?(.*?)'?;" DOWNLOAD_LINK_PATTERN = r"location.href = '(.*?)'" RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"' ADSCAPTCHA_SRC_PATTERN = r'(http://api.adscaptcha.com/Get.aspx[^"\']*)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' - + def getAPIResponse(self, cmd): - json = self.load('%s/%s' % (self.API_URL, cmd), - get = {'sid': self.account.getAccountData(self.user).get('SID'), - 'url': self.pyfile.url}) - self.logDebug('API:%s' % cmd, json) - json = json_loads(json) - - status = json['response_status'] + try: + json = self.load('%s/%s' % (self.API_URL, cmd), + get = {'sid': self.account.getAccountData(self.user).get('SID'), + 'url': self.pyfile.url}, decode = True) + self.logDebug('API:%s' % cmd, json) + json = json_loads(json) + status = json['response_status'] + msg = json['response_details'] + except BadHeader, e: + self.logError('API:%s' % cmd, e) + status = e.code + msg = e + if status == 200: return json['response'] elif status == 401: - self.account.relogin(self.user) - self.retry() + self.retry() elif status == 423: self.account.empty(self.user) self.retry() else: - self.fail(json['response_details']) - + self.fail(msg) + def handlePremium(self): + self.account.relogin(self.user) self.api_data = self.getAPIResponse('info') + self.api_data['md5'] = self.api_data['hash'] self.pyfile.name = self.api_data['filename'] - self.pyfile.size = self.api_data['size'] + self.pyfile.size = self.api_data['size'] url = self.getAPIResponse('download')['url'] - self.download(url) - + self.download(url) + def handleFree(self): if "You can download files up to 500 MB in free mode" in self.html \ or "This file can be downloaded by premium only" in self.html: self.fail("Premium account needed for download") - - self.checkWait() - + + self.checkWait() + jsvars = dict(re.findall(self.JSVARS_PATTERN, self.html)) self.logDebug(jsvars) - + self.req.http.lastURL = self.pyfile.url self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) - - url = "http://rapidgator.net%s?fid=%s" % (jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars["fid"]) + + url = "http://rapidgator.net%s?fid=%s" % (jsvars.get('startTimerUrl', '/download/AjaxStartTimer'), jsvars["fid"]) jsvars.update(self.getJsonResponse(url)) - + self.setWait(int(jsvars.get('secs', 30)) + 1, False) self.wait() - + url = "http://rapidgator.net%s?sid=%s" % (jsvars.get('getDownloadUrl', '/download/AjaxGetDownload'), jsvars["sid"]) jsvars.update(self.getJsonResponse(url)) - + self.req.http.lastURL = self.pyfile.url self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With:"]) - + url = "http://rapidgator.net%s" % jsvars.get('captchaUrl', '/download/captcha') self.html = self.load(url) found = re.search(self.ADSCAPTCHA_SRC_PATTERN, self.html) @@ -105,7 +113,7 @@ class RapidgatorNet(SimpleHoster): if found: captcha_key = found.group(1) captcha = ReCaptcha(self) - + else: found = re.search(self.SOLVEMEDIA_PATTERN, self.html) if found: @@ -116,8 +124,8 @@ class RapidgatorNet(SimpleHoster): if captcha.__class__.__name__ == "SolveMedia": captcha_prov = "adcopy" else: - captcha_prov = captcha.__class__.__name__.lower() - + captcha_prov = captcha.__class__.__name__.lower() + for i in range(5): self.checkWait() captcha_challenge, captcha_response = captcha.challenge(captcha_key) @@ -135,14 +143,14 @@ class RapidgatorNet(SimpleHoster): break else: self.fail("No valid captcha solution received") - + found = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) if not found: self.parseError("download link") download_url = found.group(1) self.logDebug(download_url) self.download(download_url) - + def checkWait(self): found = re.search(r"(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)", self.html) if found: @@ -153,17 +161,17 @@ class RapidgatorNet(SimpleHoster): wait_time = 60 else: return - + self.logDebug("Waiting %d minutes" % wait_time) self.setWait(wait_time * 60, True) self.wait() self.retry(max_tries = 24) - + def getJsonResponse(self, url): response = self.load(url, decode = True) if not response.startswith('{'): - self.retry() + self.retry() self.logDebug(url, response) - return json_loads(response) + return json_loads(response) getInfo = create_getInfo(RapidgatorNet) \ No newline at end of file -- cgit v1.2.3 From 139722a9355947f8e0696f46e3bb97c239514a37 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Mon, 8 Oct 2012 22:28:35 +0200 Subject: filebeer workaround, rehost.to chunklimit, multihoster config --- module/plugins/hoster/RehostTo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py index 370adf077..141dcb8c8 100644 --- a/module/plugins/hoster/RehostTo.py +++ b/module/plugins/hoster/RehostTo.py @@ -6,9 +6,8 @@ from module.plugins.Hoster import Hoster class RehostTo(Hoster): __name__ = "RehostTo" - __version__ = "0.1" + __version__ = "0.11" __type__ = "hoster" - __pattern__ = r"https?://.*rehost.to\..*" __description__ = """rehost.com hoster plugin""" __author_name__ = ("RaNaN") @@ -18,7 +17,7 @@ class RehostTo(Hoster): return unquote(url.rsplit("/", 1)[1]) def setup(self): - self.chunkLimit = 3 + self.chunkLimit = 1 self.resumeDownload = True def process(self, pyfile): -- cgit v1.2.3 From b01b2b3d9559b8352ee65ee2eff30843e6071987 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 9 Oct 2012 01:10:18 +0200 Subject: euroshare.eu premium --- module/plugins/hoster/EuroshareEu.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index 2c356f02a..79df56ac4 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -23,7 +23,7 @@ class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" __pattern__ = r"http://(\w*\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*" - __version__ = "0.21" + __version__ = "0.22" __description__ = """Euroshare.eu""" __author_name__ = ("zoidberg") @@ -31,11 +31,16 @@ class EuroshareEu(SimpleHoster): FILE_OFFLINE_PATTERN = ur'

    S.bor sa nena.iel

    |Požadovaná stránka neexistuje!' FREE_URL_PATTERN = r'
    Prebieha s.ahovanie' + ERR_PARDL_PATTERN = r'

    Prebieha s.ahovanie

    |

    Naraz je z jednej IP adresy mo.n. s.ahova. iba jeden s.bor' + + FILE_URL_REPLACEMENTS = [(r"(http://[^/]*\.)(sk|cz|hu|pl)/", r"\1eu/")] + + def handlePremium(self): + self.download(self.pyfile.url.rstrip('/') + "/download/") def handleFree(self): if re.search(self.ERR_PARDL_PATTERN, self.html) is not None: - self.waitForFreeSlot() + self.longWait(300, 12) found = re.search(self.FREE_URL_PATTERN, self.html) if found is None: @@ -43,8 +48,9 @@ class EuroshareEu(SimpleHoster): parsed_url = "http://euroshare.eu%s" % found.group(1) self.logDebug("URL", parsed_url) self.download(parsed_url, disposition=True) - - def waitForFreeSlot(self): - self.setWait(300, True) - self.wait() - self.retry() \ No newline at end of file + + check = self.checkDownload({"multi_dl": re.compile(self.ERR_PARDL_PATTERN)}) + if check == "multi_dl": + self.longWait(300, 12) + +getInfo = create_getInfo(EuroshareEu) \ No newline at end of file -- cgit v1.2.3 From 87effaa3c99406ec8f8de157fcfc39ccb0a92b8b Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Wed, 10 Oct 2012 23:41:06 +0200 Subject: fix sharerapid, euroshare --- module/plugins/hoster/EuroshareEu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py index 79df56ac4..448862f5b 100644 --- a/module/plugins/hoster/EuroshareEu.py +++ b/module/plugins/hoster/EuroshareEu.py @@ -17,13 +17,13 @@ """ import re -from module.plugins.internal.SimpleHoster import SimpleHoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EuroshareEu(SimpleHoster): __name__ = "EuroshareEu" __type__ = "hoster" __pattern__ = r"http://(\w*\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*" - __version__ = "0.22" + __version__ = "0.23" __description__ = """Euroshare.eu""" __author_name__ = ("zoidberg") -- cgit v1.2.3 From de034056468bb5cea26351be1d76f01fd2826395 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Fri, 12 Oct 2012 23:53:45 +0200 Subject: Cleanup. --- 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 ----------- 15 files changed, 1324 deletions(-) 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 (limited to 'module/plugins/hoster') 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 . - - @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\d+)/.+" - __version__ = "0.12" - __description__ = """CoolShare.cz""" - __author_name__ = ("zoidberg") - - FILE_NAME_PATTERN = ur'Stáhnout (?P[^<]+)' - FILE_SIZE_PATTERN = 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 ' Date: Sun, 14 Oct 2012 01:12:59 +0200 Subject: update CaptchaBrotherhood - closed #696, sharerapid.com --- module/plugins/hoster/ShareRapidCom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/ShareRapidCom.py b/module/plugins/hoster/ShareRapidCom.py index 4a25d4027..aff88c6ac 100644 --- a/module/plugins/hoster/ShareRapidCom.py +++ b/module/plugins/hoster/ShareRapidCom.py @@ -44,8 +44,8 @@ def getInfo(urls): class ShareRapidCom(SimpleHoster): __name__ = "ShareRapidCom" __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/stahuj/(.+)" - __version__ = "0.50" + __pattern__ = r"http://(?:www\.)?((share(-?rapid\.(biz|com|cz|info|eu|net|org|pl|sk)|-(central|credit|free|net)\.cz|-ms\.net)|(s-?rapid|rapids)\.(cz|sk))|(e-stahuj|mediatack|premium-rapidshare|rapidshare-premium|qiuck)\.cz|kadzet\.com|stahuj-zdarma\.eu|strelci\.net|universal-share\.com)/stahuj/(\w+)" + __version__ = "0.51" __description__ = """Share-rapid.com plugin - premium only""" __author_name__ = ("MikyWoW", "zoidberg") __author_mail__ = ("MikyWoW@seznam.cz", "zoidberg@mujmail.cz") @@ -57,6 +57,8 @@ class ShareRapidCom(SimpleHoster): DOWNLOAD_URL_PATTERN = r'([^<]+)' ERR_LOGIN_PATTERN = ur'
    Stahování je přístupné pouze přihlášeným uživatelům' ERR_CREDIT_PATTERN = ur'
    Stahování zdarma je možné jen přes náš' + + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://share-rapid.com/stahuj/\1')] def setup(self): self.chunkLimit = 1 -- cgit v1.2.3 From 1b494bca9f442b3a8dd75818c68f41235dcdbdfe Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sat, 20 Oct 2012 09:30:04 +0200 Subject: small plugin fixes, closed #694, #695 --- module/plugins/hoster/HellspyCz.py | 6 +++--- module/plugins/hoster/RapidgatorNet.py | 5 +++-- module/plugins/hoster/WebshareCz.py | 5 ++++- module/plugins/hoster/XFileSharingPro.py | 16 ++++++++-------- 4 files changed, 18 insertions(+), 14 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/HellspyCz.py b/module/plugins/hoster/HellspyCz.py index 22838b481..ad0cccd54 100644 --- a/module/plugins/hoster/HellspyCz.py +++ b/module/plugins/hoster/HellspyCz.py @@ -22,15 +22,15 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class HellspyCz(SimpleHoster): __name__ = "HellspyCz" __type__ = "hoster" - __pattern__ = r"http://(?:\w*\.)*hellspy\.(?:cz|com|sk|hu)(/\S+/\d+)/?.*" - __version__ = "0.25" + __pattern__ = r"http://(?:\w*\.)*(?:hellspy\.(?:cz|com|sk|hu|pl)|sciagaj.pl)(/\S+/\d+)/?.*" + __version__ = "0.26" __description__ = """HellSpy.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") FILE_INFO_PATTERN = '(?P[0-9.]+) (?P[kKMG])i?B\s*

    (404 - Page|File) not found

    ' - FILE_URL_REPLACEMENTS = [(r"http://(?:\w*\.)*hellspy\.(?:cz|com|sk|hu)(/\S+/\d+)/?.*", r"http://www.hellspy.com\1")] + FILE_URL_REPLACEMENTS = [(__pattern__, r"http://www.hellspy.com\1")] CREDIT_LEFT_PATTERN = r'Credits: \s*(\d+)' DOWNLOAD_AGAIN_PATTERN = r']*title="You can download the file without deducting your credit.">' diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index ad23b5a33..f0d64cae1 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -29,7 +29,7 @@ class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)" - __version__ = "0.10" + __version__ = "0.11" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg","chrox") @@ -61,6 +61,7 @@ class RapidgatorNet(SimpleHoster): if status == 200: return json['response'] elif status == 401: + self.account.relogin(self.user) self.retry() elif status == 423: self.account.empty(self.user) @@ -69,7 +70,7 @@ class RapidgatorNet(SimpleHoster): self.fail(msg) def handlePremium(self): - self.account.relogin(self.user) + #self.logDebug("ACCOUNT_DATA", self.account.getAccountData(self.user)) self.api_data = self.getAPIResponse('info') self.api_data['md5'] = self.api_data['hash'] self.pyfile.name = self.api_data['filename'] diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py index b60fda7e4..195e65a93 100644 --- a/module/plugins/hoster/WebshareCz.py +++ b/module/plugins/hoster/WebshareCz.py @@ -24,7 +24,7 @@ class WebshareCz(SimpleHoster): __name__ = "WebshareCz" __type__ = "hoster" __pattern__ = r"http://(\w+\.)?webshare.cz/(stahnout/)?(?P\w{10})-.+" - __version__ = "0.11" + __version__ = "0.12" __description__ = """WebShare.cz""" __author_name__ = ("zoidberg") @@ -33,6 +33,9 @@ class WebshareCz(SimpleHoster): FILE_OFFLINE_PATTERN = r'

    Soubor ".*?" nebyl nalezen.

    ' DOWNLOAD_LINK_PATTERN = r'id="download_link" href="(?P.*?)"' + + def setup(self): + self.multiDL = True def handleFree(self): url_a = re.search(r"(var l.*)", self.html).group(1) diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index ef559a56f..713198754 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -34,7 +34,7 @@ class XFileSharingPro(SimpleHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.12" + __version__ = "0.13" __description__ = """XFileSharingPro common hoster base""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -126,7 +126,7 @@ class XFileSharingPro(SimpleHoster): break else: - if captcha in self.err: + if self.errmsg and 'captcha' in self.errmsg: self.fail("No valid captcha code entered") else: self.fail("Download link not found") @@ -185,20 +185,20 @@ class XFileSharingPro(SimpleHoster): wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in re.findall('(\d+)\s*(hour|minute|second)?', self.errmsg)]) self.setWait(wait_time, True) self.wait() + elif 'captcha' in self.errmsg: + self.invalidCaptcha() + elif 'premium' in self.errmsg and 'require' in self.errmsg: + self.fail("File can be downloaded by premium users only") elif 'limit' in self.errmsg: self.setWait(3600, True) self.wait() self.retry(25) - elif 'captcha' in self.errmsg: - self.invalidCaptcha() elif 'countdown' in self.errmsg or 'Expired session' in self.errmsg: self.retry(3) elif 'maintenance' in self.errmsg: self.tempOffline() elif 'download files up to' in self.errmsg: self.fail("File too large for free download") - elif 'requires premium' in self.errmsg: - self.fail("File can be downloaded by premium users only") else: self.fail(self.errmsg) @@ -211,9 +211,9 @@ class XFileSharingPro(SimpleHoster): for i in range(3): if not self.errmsg: self.checkErrors() - action, inputs = self.parseHtmlForm(self.FORM_PATTERN) + action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) if not inputs: - action, inputs = self.parseHtmlForm("action=(''|\"\")") + action, inputs = self.parseHtmlForm(self.FORM_PATTERN) if not inputs: if self.errmsg: self.retry() -- cgit v1.2.3 From f4ff2b29cc39105de2845cdfbf90a4517e33bd86 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sat, 20 Oct 2012 23:13:17 +0200 Subject: rapidgator.net, shareonline.biz - closed #701 --- module/plugins/hoster/RapidgatorNet.py | 34 +++++++++++++++++++++++++-------- module/plugins/hoster/ShareonlineBiz.py | 11 ++++++----- 2 files changed, 32 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index f0d64cae1..b7e382c4e 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -29,7 +29,7 @@ class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)" - __version__ = "0.11" + __version__ = "0.12" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg","chrox") @@ -43,31 +43,45 @@ class RapidgatorNet(SimpleHoster): RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"' ADSCAPTCHA_SRC_PATTERN = r'(http://api.adscaptcha.com/Get.aspx[^"\']*)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' + + def setup(self): + self.resumeDownload = False + self.multiDL = False + self.sid = None + self.chunkLimit = 1 + self.req.setOption("timeout", 120) + + def process(self, pyfile): + if self.account: + self.sid = self.account.getAccountData(self.user).get('SID', None) + + if self.sid: + self.handlePremium() + else: + self.handleFree() def getAPIResponse(self, cmd): try: json = self.load('%s/%s' % (self.API_URL, cmd), - get = {'sid': self.account.getAccountData(self.user).get('SID'), + get = {'sid': self.sid, 'url': self.pyfile.url}, decode = True) - self.logDebug('API:%s' % cmd, json) + self.logDebug('API:%s' % cmd, json, "SID: %s" % self.sid) json = json_loads(json) status = json['response_status'] msg = json['response_details'] except BadHeader, e: - self.logError('API:%s' % cmd, e) + self.logError('API:%s' % cmd, e, "SID: %s" % self.sid) status = e.code msg = e if status == 200: return json['response'] - elif status == 401: - self.account.relogin(self.user) - self.retry() elif status == 423: self.account.empty(self.user) self.retry() else: - self.fail(msg) + self.account.relogin(self.user) + self.retry(wait_time=60) def handlePremium(self): #self.logDebug("ACCOUNT_DATA", self.account.getAccountData(self.user)) @@ -76,9 +90,13 @@ class RapidgatorNet(SimpleHoster): self.pyfile.name = self.api_data['filename'] self.pyfile.size = self.api_data['size'] url = self.getAPIResponse('download')['url'] + self.multiDL = True self.download(url) def handleFree(self): + self.html = self.load(self.pyfile.url, decode = True) + self.getFileInfo() + if "You can download files up to 500 MB in free mode" in self.html \ or "This file can be downloaded by premium only" in self.html: self.fail("Premium account needed for download") diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index e47aa0e5e..383f933ff 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -17,7 +17,7 @@ def getInfo(urls): for chunk in chunks(urls, 90): api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","").rstrip("/") for x in chunk)} #api only supports old style links - src = getURL(api_url_base, post=api_param_file) + src = getURL(api_url_base, post=api_param_file, decode=True) result = [] for i, res in enumerate(src.split("\n")): if not res: @@ -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.34" + __version__ = "0.35" __description__ = """Shareonline.biz Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -57,7 +57,8 @@ class ShareonlineBiz(Hoster): self.file_id = re.search(r"(id\=|/dl/)([a-zA-Z0-9]+)", self.pyfile.url).group(2) self.pyfile.url = "http://www.share-online.biz/dl/" + self.file_id - self.resumeDownload = self.multiDL = self.premium + self.resumeDownload = self.premium + self.multiDL = False #self.chunkLimit = 1 self.check_data = None @@ -84,7 +85,7 @@ class ShareonlineBiz(Hoster): def downloadAPIData(self): api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1" api_param_file = {"links": self.pyfile.url.replace("http://www.share-online.biz/dl/","")} #api only supports old style links - src = self.load(api_url_base, cookies=False, post=api_param_file) + src = self.load(api_url_base, cookies=False, post=api_param_file, decode=True) fields = src.split(";") self.api_data = {"fileid": fields[0], @@ -139,7 +140,6 @@ class ShareonlineBiz(Hoster): self.retry(5, 60, "Cookie failure") elif check == "fail": self.retry(5, 300, "Download failed") - def checkErrors(self): found = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL) @@ -182,6 +182,7 @@ class ShareonlineBiz(Hoster): if dlLink == "server_under_maintenance": self.tempoffline() else: + self.multiDL = True self.download(dlLink) def checksum(self, local_file): -- cgit v1.2.3 From 0ed9a4701df16cfbc06330c51fcf049b32e6258a Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Fri, 26 Oct 2012 08:50:33 +0200 Subject: update youtube plugin - closed #686 --- module/plugins/hoster/HellspyCz.py | 5 +++-- module/plugins/hoster/YoutubeCom.py | 34 +++++++++++++++++----------------- 2 files changed, 20 insertions(+), 19 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/HellspyCz.py b/module/plugins/hoster/HellspyCz.py index ad0cccd54..9858c82b7 100644 --- a/module/plugins/hoster/HellspyCz.py +++ b/module/plugins/hoster/HellspyCz.py @@ -23,12 +23,13 @@ class HellspyCz(SimpleHoster): __name__ = "HellspyCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*(?:hellspy\.(?:cz|com|sk|hu|pl)|sciagaj.pl)(/\S+/\d+)/?.*" - __version__ = "0.26" + __version__ = "0.27" __description__ = """HellSpy.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") - FILE_INFO_PATTERN = '(?P[0-9.]+) (?P[kKMG])i?B\s*

    (?P[0-9.]+)\s*(?P[kKMG])i?B' + FILE_NAME_PATTERN = r'

    (404 - Page|File) not found

    ' FILE_URL_REPLACEMENTS = [(__pattern__, r"http://www.hellspy.com\1")] diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 222e9bf84..c1812a8fb 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -10,8 +10,8 @@ from module.plugins.Hoster import Hoster class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" - __pattern__ = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" - __version__ = "0.25" + __pattern__ = r"(http|https)://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" + __version__ = "0.26" __config__ = [("quality", "sd;hd;fullhd", "Quality Setting", "hd"), ("fmt", "int", "FMT Number 0-45", 0), (".mp4", "bool", "Allow .mp4", True), @@ -19,8 +19,8 @@ class YoutubeCom(Hoster): (".webm", "bool", "Allow .webm", False), (".3gp", "bool", "Allow .3gp", False)] __description__ = """Youtube.com Video Download Hoster""" - __author_name__ = ("spoob") - __author_mail__ = ("spoob@pyload.org") + __author_name__ = ("spoob", "zoidberg") + __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") # name, width, height, quality ranking formats = {17: (".3gp", 176, 144, 0), @@ -63,22 +63,20 @@ class YoutubeCom(Hoster): if self.getConfig("fmt"): desired_fmt = self.getConf("fmt") - - flashvars = re.search(r'flashvars=\\"(.*?)\\"', html) - flashvars = unquote(flashvars.group(1)) - - fmts = re.findall(r'url=(.*?)%3B.*?itag=(\d+)', flashvars) + + streams = unquote(re.search(r'url_encoded_fmt_stream_map=(.*?);', html).group(1)) + streams = [x.split('&') for x in streams.split(',')] + streams = [dict((y.split('=')) for y in x) for x in streams] fmt_dict = {} - for url, fmt in fmts: - fmt = int(fmt) - fmt_dict[fmt] = unquote(url) - + for x in streams: + x.update(itag=int(x['itag']), url=unquote(x['url']), type=unquote(x['type'])) + fmt_dict[x['itag']] = "%s&signature=%s" % (x['url'], x['sig']) self.logDebug("Found links: %s" % fmt_dict) for fmt in fmt_dict.keys(): if fmt not in self.formats: - self.logDebug("FMT not supported: %s" % fmt) - del fmt_dict[fmt] + self.logDebug("FMT not supported: %s" % fmt) + del fmt_dict[fmt] allowed = lambda x: self.getConfig(self.formats[x][0]) sel = lambda x: self.formats[x][3] #select quality index @@ -90,11 +88,13 @@ class YoutubeCom(Hoster): allowed(x) else y, fmt_dict.keys()) self.logDebug("Choose fmt: %s" % fmt) + url = fmt_dict[fmt] + self.logDebug("URL: %s" % url) file_suffix = ".flv" if fmt in self.formats: file_suffix = self.formats[fmt][0] name = re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix pyfile.name = html_unescape(name) - - self.download(fmt_dict[fmt]) + + self.download(url) \ No newline at end of file -- cgit v1.2.3 From bebb155fd45a9cd6a4af25bd5e365cc39f6bd55d Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Fri, 26 Oct 2012 09:06:12 +0200 Subject: gamefront.com plugin - thanx fwannmacher - closed #705 --- module/plugins/hoster/GamefrontCom.py | 79 +++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 module/plugins/hoster/GamefrontCom.py (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/GamefrontCom.py b/module/plugins/hoster/GamefrontCom.py new file mode 100644 index 000000000..1e3ca77e5 --- /dev/null +++ b/module/plugins/hoster/GamefrontCom.py @@ -0,0 +1,79 @@ +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +class GamefrontCom(Hoster): + __name__ = "GamefrontCom" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)*?gamefront.com/files/[A-Za-z0-9]+" + __version__ = "0.01" + __description__ = """gamefront.com hoster plugin""" + __author_name__ = ("fwannmacher") + __author_mail__ = ("felipe@warhammerproject.com") + + HOSTER_NAME = "gamefront.com" + PATTERN_FILENAME = r'(.*?) | Game Front' + PATTERN_FILESIZE = r'<dt>File Size:</dt>[\n\s]*<dd>(.*?)</dd>' + PATTERN_OFFLINE = "This file doesn't exist, or has been removed." + + def setup(self): + self.resumeDownload = True + self.multiDL = False + + def process(self, pyfile): + self.pyfile = pyfile + self.html = self.load(pyfile.url, decode=True) + + if not self._checkOnline(): + self.offline() + + self.pyfile.name = self._getName() + + self.link = self._getLink() + + if not self.link.startswith('http://'): + self.link = "http://www.gamefront.com/" + self.link + + self.download(self.link) + + def _checkOnline(self): + if re.search(self.PATTERN_OFFLINE, self.html): + return False + else: + return True + + def _getName(self): + name = re.search(self.PATTERN_FILENAME, self.html) + if name is None: + self.fail("%s: Plugin broken." % self.__name__) + + return name.group(1) + + def _getLink(self): + self.html2 = self.load("http://www.gamefront.com/" + re.search("(files/service/thankyou\\?id=[A-Za-z0-9]+)", self.html).group(1)) + self.link = re.search("<a href=\"(http://media[0-9]+\.gamefront.com/.*)\">click here</a>", self.html2) + + return self.link.group(1).replace("&", "&") + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url) + + if re.search(GamefrontCom.PATTERN_OFFLINE, html): + result.append((url, 0, 1, url)) + else: + name = re.search(GamefrontCom.PATTERN_FILENAME, html) + + if name is None: + result.append((url, 0, 1, url)) + continue + + name = name.group(1) + size = re.search(GamefrontCom.PATTERN_FILESIZE, html) + size = parseFileSize(size.group(1)) + + result.append((name, size, 3, url)) + + yield result \ No newline at end of file -- cgit v1.2.3 From e195f96d1a4d31a1e59d7f23971edd14a1edd220 Mon Sep 17 00:00:00 2001 From: zoidberg10 <zoidberg@mujmail.cz> Date: Sat, 27 Oct 2012 01:57:45 +0200 Subject: youtube - add 3D formats, update playlist crypter --- module/plugins/hoster/GamefrontCom.py | 3 +- module/plugins/hoster/YoutubeCom.py | 118 ++++++++++++++++++---------------- 2 files changed, 65 insertions(+), 56 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/GamefrontCom.py b/module/plugins/hoster/GamefrontCom.py index 1e3ca77e5..34fda09d2 100644 --- a/module/plugins/hoster/GamefrontCom.py +++ b/module/plugins/hoster/GamefrontCom.py @@ -1,12 +1,13 @@ import re from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL +from module.utils import parseFileSize class GamefrontCom(Hoster): __name__ = "GamefrontCom" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)*?gamefront.com/files/[A-Za-z0-9]+" - __version__ = "0.01" + __version__ = "0.02" __description__ = """gamefront.com hoster plugin""" __author_name__ = ("fwannmacher") __author_mail__ = ("felipe@warhammerproject.com") diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index c1812a8fb..c9e8a1c7a 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -11,29 +11,40 @@ class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" __pattern__ = r"(http|https)://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" - __version__ = "0.26" + __version__ = "0.27" __config__ = [("quality", "sd;hd;fullhd", "Quality Setting", "hd"), - ("fmt", "int", "FMT Number 0-45", 0), + ("fmt", "int", "FMT Number 0-102", 0), (".mp4", "bool", "Allow .mp4", True), (".flv", "bool", "Allow .flv", True), (".webm", "bool", "Allow .webm", False), - (".3gp", "bool", "Allow .3gp", False)] + (".3gp", "bool", "Allow .3gp", False), + ("3d", "bool", "Prefer 3D", False)] __description__ = """Youtube.com Video Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") - # name, width, height, quality ranking - formats = {17: (".3gp", 176, 144, 0), - 5: (".flv", 400, 240, 1), - 18: (".mp4", 480, 360, 2), - 43: (".webm", 640, 360, 3), - 34: (".flv", 640, 360, 4), - 44: (".webm", 854, 480, 5), - 35: (".flv", 854, 480, 6), - 45: (".webm", 1280, 720, 7), - 22: (".mp4", 1280, 720, 8), - 37: (".mp4", 1920, 1080, 9), - 38: (".mp4", 4096, 3072, 10), + # name, width, height, quality ranking, 3D + formats = {5: (".flv", 400, 240, 1, False), + 6: (".flv", 640, 400, 4, False), + 17: (".3gp", 176, 144, 0, False), + 18: (".mp4", 480, 360, 2, False), + 22: (".mp4", 1280, 720, 8, False), + 43: (".webm", 640, 360, 3, False), + 34: (".flv", 640, 360, 4, False), + 35: (".flv", 854, 480, 6, False), + 36: (".3gp", 400, 240, 1, False), + 37: (".mp4", 1920, 1080, 9, False), + 38: (".mp4", 4096, 3072, 10, False), + 44: (".webm", 854, 480, 5, False), + 45: (".webm", 1280, 720, 7, False), + 46: (".webm", 1920, 1080, 9, False), + 82: (".mp4", 640, 360, 3, True), + 83: (".mp4", 400, 240, 1, True), + 84: (".mp4", 1280, 720, 8, True), + 85: (".mp4", 1920, 1080, 9, True), + 100: (".webm", 640, 360, 3, True), + 101: (".webm", 640, 360, 4, True), + 102: (".webm", 1280, 720, 8, True) } @@ -45,55 +56,52 @@ class YoutubeCom(Hoster): if "We have been receiving a large volume of requests from your network." in html: self.tempOffline() - - #videoId = pyfile.url.split("v=")[1].split("&")[0] - #videoHash = re.search(r'&t=(.+?)&', html).group(1) - - file_name_pattern = '<meta name="title" content="(.+?)">' - - quality = self.getConf("quality") - desired_fmt = 18 - - if quality == "sd": - desired_fmt = 18 - elif quality == "hd": - desired_fmt = 22 - elif quality == "fullhd": - desired_fmt = 37 - - if self.getConfig("fmt"): - desired_fmt = self.getConf("fmt") + #get config + use3d = self.getConf("3d") + quality = {"sd":82,"hd":84,"fullhd":85} if use3d else {"sd":18,"hd":22,"fullhd":37} + desired_fmt = self.getConf("fmt") or quality.get(self.getConf("quality"), 18) + + #parse available streams streams = unquote(re.search(r'url_encoded_fmt_stream_map=(.*?);', html).group(1)) streams = [x.split('&') for x in streams.split(',')] streams = [dict((y.split('=')) for y in x) for x in streams] - fmt_dict = {} - for x in streams: - x.update(itag=int(x['itag']), url=unquote(x['url']), type=unquote(x['type'])) - fmt_dict[x['itag']] = "%s&signature=%s" % (x['url'], x['sig']) + streams = [(int(x['itag']), "%s&signature=%s" % (unquote(x['url']), x['sig'])) for x in streams] + #self.logDebug("Found links: %s" % streams) + self.logDebug("AVAILABLE STREAMS: %s" % [x[0] for x in streams]) - self.logDebug("Found links: %s" % fmt_dict) - for fmt in fmt_dict.keys(): - if fmt not in self.formats: - self.logDebug("FMT not supported: %s" % fmt) - del fmt_dict[fmt] - - allowed = lambda x: self.getConfig(self.formats[x][0]) - sel = lambda x: self.formats[x][3] #select quality index - comp = lambda x, y: abs(sel(x) - sel(y)) - - #return fmt nearest to quali index - fmt = reduce(lambda x, y: x if comp(x, desired_fmt) <= comp(y, desired_fmt) and - sel(x) > sel(y) and - allowed(x) else y, fmt_dict.keys()) + #build dictionary of supported itags (3D/2D) + allowed = lambda x: self.getConfig(self.formats[x][0]) + streams = [x for x in streams if x[0] in self.formats and allowed(x[0])] + if not streams: + self.fail("No available stream meets your preferences") + fmt_dict = dict([x for x in streams if self.formats[x[0]][4] == use3d] or streams) + + self.logDebug("DESIRED STREAM: ITAG:%d (%s) %sfound, %sallowed" % + (desired_fmt, + "%s %dx%d Q:%d 3D:%s" % self.formats[desired_fmt], + "" if desired_fmt in fmt_dict else "NOT ", + "" if allowed(desired_fmt) else "NOT ") + ) + + #return fmt nearest to quality index + if desired_fmt in fmt_dict and allowed(desired_fmt): + fmt = desired_fmt + else: + sel = lambda x: self.formats[x][3] #select quality index + comp = lambda x, y: abs(sel(x) - sel(y)) + + self.logDebug("Choosing nearest fmt: %s" % [(x, allowed(x), comp(x, desired_fmt)) for x in fmt_dict.keys()]) + fmt = reduce(lambda x, y: x if comp(x, desired_fmt) <= comp(y, desired_fmt) and + sel(x) > sel(y) else y, fmt_dict.keys()) - self.logDebug("Choose fmt: %s" % fmt) + self.logDebug("Chosen fmt: %s" % fmt) url = fmt_dict[fmt] self.logDebug("URL: %s" % url) - file_suffix = ".flv" - if fmt in self.formats: - file_suffix = self.formats[fmt][0] + #set file name + file_suffix = self.formats[fmt][0] if fmt in self.formats else ".flv" + file_name_pattern = '<meta name="title" content="(.+?)">' name = re.search(file_name_pattern, html).group(1).replace("/", "") + file_suffix pyfile.name = html_unescape(name) -- cgit v1.2.3 From 10882cdcf116758d7cc35a72c7432a1bf4cdd15f Mon Sep 17 00:00:00 2001 From: zoidberg10 <zoidberg@mujmail.cz> Date: Tue, 30 Oct 2012 23:57:46 +0100 Subject: update bezvadata,fastshare,dataport --- module/plugins/hoster/BezvadataCz.py | 52 ++++++++++++++++++++++++++++++------ module/plugins/hoster/DataportCz.py | 7 ++--- module/plugins/hoster/FastshareCz.py | 23 ++++++++++------ 3 files changed, 63 insertions(+), 19 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 680bbc173..37ef145b2 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -23,7 +23,7 @@ class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*" - __version__ = "0.22" + __version__ = "0.23" __description__ = """BezvaData.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -31,15 +31,51 @@ class BezvadataCz(SimpleHoster): FILE_NAME_PATTERN = r'<p><b>Soubor: (?P<N>[^<]+)</b></p>' FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[^<]+)</li>' FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen' - DOWNLOAD_FORM_PATTERN = r'
    ' + + def setup(self): + self.multiDL = self.resumeDownload = True def handleFree(self): - found = re.search(self.DOWNLOAD_FORM_PATTERN, self.html) - if found is None: self.parseError("Download form") - url = "http://bezvadata.cz" + found.group(1) - self.logDebug("Download form: %s" % url) - - self.download(url, post = {"stahnoutSoubor": "St%C3%A1hnout"}, cookies = True) + #download button + found = re.search(r'', self.html) + if not found: self.parseError("page2 URL") + url = "http://bezvadata.cz%s" % found.group(1) + self.logDebug("DL URL %s" % url) + + #countdown + found = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html) + wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120 + self.setWait(wait_time, False) + self.wait() + + self.download(url) + + def loadcaptcha(self, data, *args, **kwargs): + return data.decode("base64") getInfo = create_getInfo(BezvadataCz) \ No newline at end of file diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index cef115941..952824ec9 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -23,14 +23,15 @@ from pycurl import FOLLOWLOCATION class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" - __pattern__ = r"http://.*dataport.cz/file/.*" - __version__ = "0.35" + __pattern__ = r"http://.*dataport.cz/file/(\d+).*" + __version__ = "0.36" __description__ = """Dataport.cz plugin - free only""" __author_name__ = ("zoidberg") FILE_NAME_PATTERN = r'(?P[^<]+)' FILE_SIZE_PATTERN = r'Velikost\s*(?P[^<]+)' FILE_OFFLINE_PATTERN = r'

    Soubor nebyl nalezen

    ' + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] CAPTCHA_URL_PATTERN = r'
    \s*(\d+)
    ' @@ -49,7 +50,7 @@ class DataportCz(SimpleHoster): else: raise PluginParseError('captcha') - self.html = self.download("http://dataport.cz%s" % action, post = inputs) + self.html = self.download("http://www.dataport.cz%s" % action, post = inputs) check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index d71684166..cc0b18c96 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -23,14 +23,14 @@ class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?fastshare.cz/\d+/.+" - __version__ = "0.13" + __version__ = "0.14" __description__ = """FastShare.cz""" __author_name__ = ("zoidberg") - FILE_NAME_PATTERN = r'

    (?P[^<]+)

    ' + FILE_NAME_PATTERN = r'(?P[^<]+)' FILE_SIZE_PATTERN = r'Velikost: (?P[^<]+)' - FILE_OFFLINE_PATTERN = r'
    \s*
    Tento soubor byl smazán' + SH_COOKIES = [("fastshare.cz","lang","cs")] FILE_URL_REPLACEMENTS = [('#.*','')] FREE_URL_PATTERN = ur'Stáhnout FREE.*?' @@ -38,31 +38,38 @@ class FastshareCz(SimpleHoster): NOT_ENOUGH_CREDIC_PATTERN = "Nem.te dostate.n. kredit pro sta.en. tohoto souboru" def handleFree(self): + if u">100% FREE slotů je plných.<" in self.html: + self.setWait(60, False) + self.wait() + self.retry(120, "No free slots") + found = re.search(self.FREE_URL_PATTERN, self.html) if not found: self.parseError("Free URL") action, captcha_src = found.groups() captcha = self.decryptCaptcha("http://www.fastshare.cz/" + captcha_src) self.download("http://www.fastshare.cz/" + action, post = {"code": captcha, "submit": u"stáhnout"}) - check = self.checkDownload({"paralell_dl": "