diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-09-18 19:04:05 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-09-18 19:04:05 +0200 |
commit | cb7bb3881a76e85110868643be04d200113d88f2 (patch) | |
tree | abc99358b0249c998e477a69c1bc922b7d04ef6d | |
parent | closed #371 (diff) | |
download | pyload-cb7bb3881a76e85110868643be04d200113d88f2.tar.xz |
plugin pack by zoidberg
-rw-r--r-- | .hgignore | 2 | ||||
-rw-r--r-- | module/plugins/accounts/HellshareCz.py | 54 | ||||
-rw-r--r-- | module/plugins/crypter/LinkdecrypterCom.py | 83 | ||||
-rw-r--r-- | module/plugins/crypter/MultiloadCz.py | 41 | ||||
-rw-r--r-- | module/plugins/hoster/BezvadataCz.py | 66 | ||||
-rw-r--r-- | module/plugins/hoster/CzshareCom.py | 173 | ||||
-rw-r--r-- | module/plugins/hoster/DataportCz.py | 77 | ||||
-rw-r--r-- | module/plugins/hoster/EdiskCz.py | 88 | ||||
-rw-r--r-- | module/plugins/hoster/EuroshareEu.py | 71 | ||||
-rw-r--r-- | module/plugins/hoster/FlyshareCz.py | 90 | ||||
-rw-r--r-- | module/plugins/hoster/HellshareCz.py | 161 | ||||
-rw-r--r-- | module/plugins/hoster/MultishareCz.py | 83 | ||||
-rw-r--r-- | module/plugins/hoster/NahrajCz.py | 54 | ||||
-rw-r--r-- | module/plugins/hoster/PrzeklejPl.py | 47 | ||||
-rw-r--r-- | module/plugins/hoster/QuickshareCz.py | 100 | ||||
-rw-r--r-- | module/plugins/hoster/SpeedfileCz.py | 80 | ||||
-rw-r--r-- | module/plugins/hoster/StahnuTo.py | 97 | ||||
-rw-r--r-- | module/plugins/hoster/UlozTo.py | 167 | ||||
-rw-r--r-- | module/plugins/hoster/UloziskoSk.py | 95 |
19 files changed, 1629 insertions, 0 deletions
@@ -29,3 +29,5 @@ webserver.pid *.svg *.prefs *.po +*.orig +*.rej diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py new file mode 100644 index 000000000..eb44ee47f --- /dev/null +++ b/module/plugins/accounts/HellshareCz.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +from module.plugins.Account import Account +import re + +class HellshareCz(Account): + __name__ = "HellshareCz" + __version__ = "0.1" + __type__ = "account" + __description__ = """hellshare.cz account plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + CREDIT_LEFT_PATTERN = r'<a class="button-amount-1" href="/buy-credit/" title="Your current credit">([^<]+)</a>' + + def loadAccountInfo(self, user, req): + self.relogin(user) + html = req.load("http://www.hellshare.com/") + + found = re.search(self.CREDIT_LEFT_PATTERN, html) + if found is None: + credits = 0 + else: + credits = int(found.group(1)) * 1024 + + return {"validuntil": -1, "trafficleft": credits} + + def login(self, user, data, req): + + html = req.load('http://www.hellshare.com/login?do=loginForm-submit', post={ + "login": "Log in", + "password": data["password"], + "username": user + }) + + if "<p>You input a wrong user name or wrong password</p>" in html: + self.wrongPassword() diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py new file mode 100644 index 000000000..befbfe4e6 --- /dev/null +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Crypter import Crypter + +class LinkdecrypterCom(Crypter): + __name__ = "LinkdecrypterCom" + __type__ = "crypter" + __pattern__ = r"http://(\w*\.)?(10001mb\.com|123link\.it|1cl\.in|1kh\.de|1zh\.us|2joy\.de|2so\.be|3\.ly|5\.gp|6nc\.net|7li\.in|9\.bb|adf\.ly|adflav\.com|adfoc\.us|allanalpass\.com|alturl\.com|amy\.gs|any\.gs|apurl\.ru|aurl\.es|b23\.ru|baberepublic\.com|bat5\.com|bax\.li|beam\.to|bit\.ly|blu\.cc|c\.ly|capourl\.com|cc\.st|cd\.vg|cloneurl\.com|convertircodigo\.com|crypt-it\.com|crypt\.to|cryptlink\.ws|deb\.gs|digzip\.com|djurl\.com|dl-protect\.com|dl\.dropbox\.com|doiop\.com|ehe\.me|embedupload\.com|encript\.in|encurtador\.com|enlacs\.com|evg\.in|extreme-protect\.com|fa\.by|faja\.me|fapoff\.com|fdnlinks\.com|fea\.me|fff\.to|filedeck\.net|filemirrorupload\.com|fileupster\.com|flameupload\.com|freetexthost\.com|fwd4\.me|fyad\.org|goandgrab\.info|goblig\.com|goo\.gl|h-url\.in|hasurl\.co\.cc|hide-url\.net|hidemyass\.com|hides\.at|hideurl\.biz|ho\.io|hornywood\.tv|href\.hu|id2\.tryjav\.com|ilix\.in|ily\.me|ino\.me|interupload\.com|is\.gd|ivpaste\.com|j\.mp|je\.pl|jheberg\.com|just\.as|kickupload\.com|klnk\.de|knoffl\.com|kodo\.ameoto\.com|ks\.gs|latwy\.pl|link-go\.info|link-protector\.com|link-safe\.net|link4jo\.com|linkanonimo\.com|linkbabes\.com|linkbank\.eu|linkbee\.com|linkblur\.com|linkbucks\.com|linkcrypt\.com|linkcrypt\.ws|linkencrypter\.com|linkhide\.com\.ar|linkhide\.in|linkoculto\.net|linkok\.org|linkprivado\.com|linkprivate\.net|linkprotect\.in|links-protect\.com|links-protect\.info|links\.tc|linksafe\.me|linksaver\.info|linkse\.info|linkseguro\.com\.ar|linkseguro\.org|linksole\.com|linksprotegidos\.info|linkto\.net|linkweb\.dk|linkx\.in|linkzip\.net|listedfiles\.com|littleurl\.net|lixk\.me|ljv2\.com|ll11\.org|lnk\.cm|lnk\.co|longr\.us|lovelink\.in|mcaf\.ee|megaline\.co|megaupper\.com|mhz\.me|migre\.me|miniurls\.co|minu\.me|mir\.cr|mirrorcreator\.com|mo\.by|multi-uploadeur\.com|multiupload\.com|murl\.kz|musicalmente\.info|mypaqe\.com|mypl\.us|myrapidlinks\.com|myref\.de|myurl\.in|nbanews\.us|okconsolas\.com|oneddl\.canhaz\.it|ow\.ly|p4p\.com\.es|p6l\.org|paste\.frubar\.net|paste\.hotfile-bb\.com|paste\.ubuntu\.com|paste2\.org|paste21\.info|pastebin\.com|paylesssofts\.net|poontown\.net|pqueno\.com|priva\.us|protec-link\.com|protect-ddl\.com|protect-my-links\.com|protected\.socadvnet\.com|protectlinks\.com|protectlinks\.net|protectlk\.com|protege-mes-liens\.com|ptl\.li|qooy\.com|qqc\.co|qvvo\.com|rapidfolder\.com|rapidsafe\.de|rapidsafe\.org|rapidshare\.mu|realfiles\.net|redir\.ec|ref\.so|relinka\.net|rexwo\.com|rqq\.co|rs-layer\.com|rsmonkey\.com|s2l\.biz|saf\.li|safe\.mn|safelinking\.net|saferlinks\.com|sealed\.in|seclnk\.in|seriousfiles\.com|sharebee\.com|short-link\.fr|shortlink\.ca|shorturlscript\.net|simurl\.com|sinl\.es|skroc\.pl|slexy\.org|slnky\.net|smsdl\.com|sn\.im|sonofertas\.es|spedr\.com|spreadlink\.us|star-cyber\.com|subedlc\.com|subirfacil\.com|syl\.me|szort\.pl|takemyfile\.com|takemylinks\.com|textsnip\.com|thecow\.me|thesefiles\.com|tilien\.net|tiny\.cc|tiny\.lt|tinylinks\.co|tinypaste\.com|tinyurl\.com|tinyurlscript\.info|tmf\.myegy\.com|togoto\.us|tot\.to|tra\.kz|u\.to|uberpicz\.com|ulinks\.net|ultra-protect\.com|ultrafiles\.net|undeadlink\.com|uploadjockey\.com|uploadmirrors\.com|uploadonall\.com|upmirror\.com|upsafe\.org|ur\.ly|url-go\.com|url-site\.com|url4t\.com|urla\.in|urlbeat\.net|urlcash\.net|urlcrypt\.com|urlcut\.com|urlcut\.in|urldefender\.com|urln\.tk|urlpulse\.net|urlspy\.co\.cc|urwij|uselink\.info|uucc\.cc|uze\.in|wcrypt\.in|webtooljungle\.com|weepax\.com|whackyvidz\.com|x-ls\.ru|x\.co|xa\.ly|xc\.io|xr\.com|xtreemhost\.com|xurl\.cn|xxs\.ru|ysu\.me|yyv\.co|zff\.co|zio\.in|zpag\.es)/.*" + __version__ = "0.2" + __description__ = """linkdecrypter.com""" + __author_name__ = ("zoidberg") + + TEXTAREA_PATTERN = r'<textarea name="links" wrap="off" readonly="1" class="caja_des">(.+)</textarea>' + PASSWORD_PATTERN = r'<p class="textog" style="color:red"><b>PASSWORD:</b></p>' + CAPTCHA_PATTERN = r'<img style="cursor:crosshair;" src="([^"]+)" alt="Loading CAPTCHA...">' + + def decrypt(self, pyfile): + self.html = self.load('http://linkdecrypter.com', post={ + "link_cache": "on", + "links": self.pyfile.url, + "modo_links": "text" + }) + + new_links = [] + captcha = '' + passwords = self.getPassword().split() + + for i in range(5 + len(passwords)): + self.logDebug("Trying to decrypt #" + str(i)) + self.html = self.load('http://linkdecrypter.com') + + textarea = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) + if textarea is not None: + self.logDebug(textarea.group(1)) + new_links.extend(textarea.group(1).split()) + break + elif re.search(self.PASSWORD_PATTERN, self.html): + if len(passwords): + password = passwords.pop(0) + self.logInfo("Password protected link, trying " + password) + self.html = self.load('http://linkdecrypter.com', post={ + "password": password + }) + else: + self.fail("No or incorrect password") + else: + found = re.search(self.CAPTCHA_PATTERN, self.html) + if found is not None: + self.logInfo("Captcha protected link") + if captcha: + self.invalidCaptcha() + captcha = self.decryptCaptcha(url='http://linkdecrypter.com/' + found.group(1)) + self.html = self.load('http://linkdecrypter.com', post={ + "captcha": captcha + }) + else: + self.fail('Max retries reached') + + if new_links: + if captcha: + self.correctCaptcha() + self.core.files.addLinks(new_links, self.pyfile.package().id) + else: + self.fail('Could not extract any links') + +
\ No newline at end of file diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py new file mode 100644 index 000000000..f34bb3483 --- /dev/null +++ b/module/plugins/crypter/MultiloadCz.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +import re +from module.plugins.Crypter import Crypter + +class MultiloadCz(Crypter): + __name__ = "MultiloadCz" + __type__ = "crypter" + __pattern__ = r"http://.*multiload.cz/(stahnout|slozka)/.*" + __version__ = "0.2b" + __description__ = """multiload.cz""" + __config__ = [ + ("usedHoster", "str", "Prefered hoster list (bar-separated) ", "rapidshare.com|uloz.to|quickshare.cz")] + __author_name__ = ("zoidberg") + + # LINK_PATTERN = r'<p class="manager-server"><strong>[^<]*</strong></p><p class="manager-linky"><a href="([^"]+)">' + FOLDER_PATTERN = r'<form action="" method="get"><textarea[^>]*>([^>]*)</textarea></form>' + + def decrypt(self, pyfile): + self.html = self.load(self.pyfile.url, decode=True) + new_links = [] + + if re.search(self.__pattern__, self.pyfile.url).group(1) == "slozka": + found = re.search(self.FOLDER_PATTERN, self.html) + if found is not None: + new_links.extend(found.group(1).split()) + else: + link_pattern = re.compile(r'<p class="manager-server"><strong>(' + + self.getConfig("usedHoster") + + r')</strong></p><p class="manager-linky"><a href="([^"]+)">') + + for found in re.finditer(link_pattern, self.html): + self.logDebug("ML URL:" + found.group(2)) + new_links.append(found.group(2)) + + if new_links: + self.core.files.addLinks(new_links, self.pyfile.package().id) + #self.packages.append((self.pyfile.package().name, new_links, self.pyfile.package().name)) + else: + self.fail('Could not extract any links') +
\ No newline at end of file diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py new file mode 100644 index 000000000..f9784142f --- /dev/null +++ b/module/plugins/hoster/BezvadataCz.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster + +class BezvadataCz(Hoster): + __name__ = "BezvadataCz" + __type__ = "hoster" + __pattern__ = r"http://(\w*\.)?bezvadata.cz/stahnout/.*" + __version__ = "0.1" + __description__ = """BezvaData.cz""" + __author_name__ = ("zoidberg") + + ID_PATTERN = r'<input type="hidden" name="souborId" value="([^"]+)">' + HASH_PATTERN = r'<input type="hidden" name="souborHash" value="([^"]+)">' + FILENAME_PATTERN = r'<title>BezvaData \| St�hnout soubor ([^<]+)</title>' + OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + if re.search(self.OFFLINE_PATTERN, self.html) is not None: + self.offline() + + found = re.search(self.FILENAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (FILENAME)") + pyfile.name = found.group(1) + + found = re.search(self.ID_PATTERN, self.html) + if found is None: + self.fail("Parse error (ID)") + souborId = found.group(1) + + found = re.search(self.ID_PATTERN, self.html) + if found is None: + self.fail("Parse error (HASH)") + souborHash = found.group(1) + + self.logDebug("URL:" + pyfile.url + " ID:" + souborId + " HASH:" + souborHash) + + self.download(pyfile.url, post={ + "souborId": souborId, + "souborHash": souborHash, + "_send": 'STAHNOUT SOUBOR' + }) +
\ No newline at end of file diff --git a/module/plugins/hoster/CzshareCom.py b/module/plugins/hoster/CzshareCom.py new file mode 100644 index 000000000..8cab02317 --- /dev/null +++ b/module/plugins/hoster/CzshareCom.py @@ -0,0 +1,173 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url, decode=True) + if re.search(CzshareCom.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(CzshareCom.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + result.append((name, 0, 2, url)) + yield result + + +class CzshareCom(Hoster): + __name__ = "CzshareCom" + __type__ = "hoster" + __pattern__ = r"http://.*czshare\.(com|cz)/.*" + __version__ = "0.6" + __description__ = """CZshare.com""" + __author_name__ = ("zoidberg") + + #FILE_URL_PATTERN = r'<a href="http://czshare.com/([^/]+)/([^/]+)/[^"]*">([^<]+)</a>' + FILE_URL_PATTERN = r'<a href="([^"]+)" class="page-download">[^>]*alt="([^"]+)" /></a>' + FORM_PATTERN = r'<form action="download.php" method="post">' + ID_PATTERN = r'<input type="hidden" name="id" value="([^"]+)" />' + FILE_PATTERN = r'<input type="hidden" name="file" value="([^"]+)" />' + #TICKET_PATTERN = r'<input type="hidden" name="ticket" value="([^"]+)" />' + SUBMIT_PATTERN = r'<input type="submit" name="freedown" value="([^"]+)" class="button" />' + SIZE_PATTERN = r'<input type="hidden" name="size" value="([^"]+)" />' + SERVER_PATTERN = r'<input type="hidden" name="server" value="([^"]+)" />' + FILE_OFFLINE_PATTERN = r'<h2 class="red">Soubor nenalezen<span> </span></h2>' + MULTIDL_PATTERN = r"<p><font color='red'>Z[^<]*PROFI.</font></p>" + FILE_NAME_PATTERN = r'<h1>([^<]+)<span> </span></h1>' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + #marks the file as "offline" when the pattern was found on the html-page + if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: + self.offline() + + # parse the name from the site and set attribute in pyfile + found = re.search(self.FILE_URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + + pyfile.name = found.group(2) + parsed_url = "http://czshare.com" + found.group(1) + + # get download ticket and parse html + self.logDebug("PARSED_URL:" + parsed_url) + self.logDebug("NAME:" + pyfile.name) + self.html = self.load(parsed_url) + + #if not re.search(self.FORM_PATTERN, self.html): + if re.search(self.MULTIDL_PATTERN, self.html): + self.waitForFreeSlot() + + parse_err = False + + found = re.search(self.SERVER_PATTERN, self.html) + if found is None: + parse_err = True + server = "" + else: + server = found.group(1) + + found = re.search(self.ID_PATTERN, self.html) + if found is None: + parse_err = True + file_id = "" + else: + file_id = found.group(1) + + found = re.search(self.FILE_PATTERN, self.html) + if found is None: + parse_err = True + long_id = "" + else: + long_id = found.group(1) + + found = re.search(self.SIZE_PATTERN, self.html) + if found is None: + parse_err = True + size = "" + else: + size = found.group(1) + + self.logDebug("ID:" + file_id + " F:" + long_id + " B:" + size + " S:" + server) + + if parse_err: + self.fail("Parse error") + + found = re.search(self.SUBMIT_PATTERN, self.html) + if found is None: + self.fail("Parse error (SUBMIT)") + else: + submit = found.group(1) + + # get and decrypt captcha + captcha_url = 'http://czshare.com/captcha.php' + """ + if self.getConfig("randomCaptcha") == True: + captcha = ''.join(random.choice('abcdefghijklmnopqrstuvwxyz') for i in range(5)) + else: + """ + captcha = self.decryptCaptcha(captcha_url) + self.logDebug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha) + + """ + self.setWait(self.getConfig("multiWait"), True) + self.wait() + """ + + # download the file, destination is determined by pyLoad + #download_url = 'http://czshare.com/free.php' + self.download(parsed_url, post={ + "id": file_id, + "file": long_id, + "size": size, + "server": server, + "captchastring2": captcha, + "freedown": submit + }) + + # check download + check = self.checkDownload({ + "tempoffline": re.compile(r"^Soubor je do.asn. nedostupn.$"), + "multi_dl": re.compile(self.MULTIDL_PATTERN), + "captcha_err": re.compile(self.SUBMIT_PATTERN) + }) + + if check == "tempoffline": + self.fail("File not available - try later") + elif check == "multi_dl": + self.waitForFreeSlot() + elif check == "captcha_err": + self.invalidCaptcha() + self.retry() + + def waitForFreeSlot(self): + self.setWait(900, True) + self.wait() + self.retry()
\ No newline at end of file diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py new file mode 100644 index 000000000..ea1ed1282 --- /dev/null +++ b/module/plugins/hoster/DataportCz.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url, decode=True) + if re.search(DataportCz.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(DataportCz.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + result.append((name, 0, 2, url)) + yield result + + +class DataportCz(Hoster): + __name__ = "DataportCz" + __type__ = "hoster" + __pattern__ = r"http://.*dataport.cz/file/.*" + __version__ = "0.3" + __description__ = """dataport.cz""" + __author_name__ = ("zoidberg") + + FILE_NAME_PATTERN = r'<h2 style="color: red;">([^<]+)</h2>' + URL_PATTERN = r'<td><a href="([^"]+)"[^>]*class="ui-state-default button hover ui-corner-all "><strong>' + NO_SLOTS_PATTERN = r'<td><a href="http://dataport.cz/kredit/"[^>]*class="ui-state-default button hover ui-corner-all ui-state-disabled">' + FILE_OFFLINE_PATTERN = r'<h2>Soubor nebyl nalezen</h2>' + + 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): + self.offline() + + if re.search(self.NO_SLOTS_PATTERN, self.html): + self.setWait(900, True) + self.wait() + self.retry() + + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (NAME)") + pyfile.name = found.group(1) + + found = re.search(self.URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + download_url = found.group(1) + + self.download(download_url) diff --git a/module/plugins/hoster/EdiskCz.py b/module/plugins/hoster/EdiskCz.py new file mode 100644 index 000000000..f5291547f --- /dev/null +++ b/module/plugins/hoster/EdiskCz.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 <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url, decode=True) + if re.search(EdiskCz.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(EdiskCz.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + result.append((name, 0, 2, url)) + yield result + + +class EdiskCz(Hoster): + __name__ = "EdiskCz" + __type__ = "hoster" + __pattern__ = r"http://(\w*\.)?edisk.(cz|sk|eu)/(stahni|sk/stahni|en/download)/.*" + __version__ = "0.2" + __description__ = """Edisk.cz""" + __author_name__ = ("zoidberg") + + URL_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">' + FILE_NAME_PATTERN = r'<span class="fl" title="([^"]+)">' + ACTION_PATTERN = r'/en/download/(\d+/.*\.html)' + DLLINK_PATTERN = r'http://.*edisk.cz.*\.html' + FILE_OFFLINE_PATTERN = r'<h3>This file does not exist due to one of the following:</h3><ul><li>' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + url = re.sub("/(stahni|sk/stahni)/", "/en/download/", pyfile.url) + + self.logDebug('URL:' + url) + + found = re.search(self.ACTION_PATTERN, url) + if found is None: + self.fail("Parse error (ACTION)") + action = found.group(1) + + self.html = self.load(url, decode=True) + + if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: + self.offline() + + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (FILENAME)") + pyfile.name = found.group(1) + + self.logDebug('NAME:' + pyfile.name) + + self.html = self.load(re.sub("/en/download/", "/en/download-slow/", url)) + + url = self.load(re.sub("/en/download/", "/x-download/", url), post={ + "action": action + }) + + if not re.match(self.DLLINK_PATTERN, url): + self.fail("Unexpected server response") + + self.download(url)
\ No newline at end of file diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py new file mode 100644 index 000000000..1cb58bc3f --- /dev/null +++ b/module/plugins/hoster/EuroshareEu.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +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): + __name__ = "EuroshareEu" + __type__ = "hoster" + __pattern__ = r"http://(\w*\.)?euroshare.eu/file/.*" + __version__ = "0.2" + __description__ = """Euroshare.eu""" + __author_name__ = ("zoidberg") + + URL_PATTERN = r'<a class="free" href="([^"]+)"></a>' + FILE_OFFLINE_PATTERN = r'<h2>S�bor sa nena.iel</h2>' + ERR_PARDL_PATTERN = r'<h2>Prebieha s.ahovanie</h2>' + + 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() + + if re.search(self.ERR_PARDL_PATTERN, self.html) is not None: + self.waitForFreeSlot() + + found = re.search(self.URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + parsed_url = found.group(1) + + self.download(parsed_url, disposition=True) + + def waitForFreeSlot(self): + self.setWait(300, True) + self.wait() + self.retry() +
\ No newline at end of file diff --git a/module/plugins/hoster/FlyshareCz.py b/module/plugins/hoster/FlyshareCz.py new file mode 100644 index 000000000..eb07f3d9e --- /dev/null +++ b/module/plugins/hoster/FlyshareCz.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url, decode=True) + if re.search(FlyshareCz.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(FlyshareCz.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + result.append((name, 0, 2, url)) + yield result + + +class FlyshareCz(Hoster): + __name__ = "FlyshareCz" + __type__ = "hoster" + __pattern__ = r"http://.*flyshare.cz/stahni/.*" + __version__ = "0.3" + __description__ = """flyshare.cz""" + __author_name__ = ("zoidberg") + + FILE_NAME_PATTERN = r'<p><span class="filename">([^<]+)</span>' + ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>' + FILE_OFFLINE_PATTERN = r'<p class="errorreport_error">Chyba: File is not available on the server</p>' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + found = re.search(self.ERR_PATTERN, self.html) + if found is not None: + err_dsc = found.group(1) + if err_dsc == "Too many simultaneous downloads, try again later": + self.waitForFreeSlot() + elif err_dsc == "File is not available on the server": + self.offline() + else: + self.fail(err_dsc) + + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error") + pyfile.name = found.group(1) + + self.download(pyfile.url, post={ + "wmod_command": "wmod_fileshare3:startDownload", + "method": "free" + }) + + check = self.checkDownload({ + "sim_dl": '<p class="errorreport_error">Chyba: Too many simultaneous downloads, try again later</p>' + }) + + if check == "sim_dl": + self.waitForFreeSlot() + + def waitForFreeSlot(self): + self.setWait(600, True) + self.wait() + self.retry() + + diff --git a/module/plugins/hoster/HellshareCz.py b/module/plugins/hoster/HellshareCz.py new file mode 100644 index 000000000..7ff5e5367 --- /dev/null +++ b/module/plugins/hoster/HellshareCz.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +import datetime +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url, decode=True) + if re.search(HellshareCz.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(HellshareCz.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + result.append((name, 0, 2, url)) + yield result + + +class HellshareCz(Hoster): + __name__ = "HellshareCz" + __type__ = "hoster" + __pattern__ = r"http://(.*\.)*hellshare\.(cz|com|sk|hu)/.*" + __version__ = "0.6" + __description__ = """Hellshare.cz""" + __author_name__ = ("zoidberg") + + FREE_URL_PATTERN = r'<a id="button-download-free" href="([^"]*)"' + PREMIUM_URL_PATTERN = r'<a onclick="return launchFullDownload[^>]*href="(http://[^/]+/([^/]+)/[^"]+)" target="full-download-iframe">' + FILE_NAME_PATTERN = r'<strong id="FileName_master">([^<]+)</strong>' + FILE_OFFLINE_PATTERN = r'<h1>Soubor nenalezen</h1>' + SERVER_PATTERN = r'<form method="post" action="([^"]+)">' + CAPTCHA_PATTERN = r'<p class="text-center marg-off"><img id="captcha-img" class="va-middle" src="([^"]+)"' + FILE_CREDITS_PATTERN = r'<strong style="font-size:20px;">(\d+)\s*credits</strong>' + CREDIT_LEFT_PATTERN = r'<a class="button-amount-1" href="[^>]*/buy-credit/" title="Your current credit">([^<]+)</a>' + DOWNLOAD_AGAIN_PATTERN = r'Soubor jste ji. stahoval - opakovan. download prob.hne zdarma. Pokra.ovat' + + def setup(self): + self.resumeDownload = self.multiDL = True if self.account else False + self.chunkLimit = 1 + + def process(self, pyfile): + if self.premium and self.account is not None: + self.account.relogin(self.user) + self.getFileInfo(pyfile) + self.handlePremium() + else: + self.getFileInfo(pyfile) + self.handleFree() + + def getFileInfo(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + #marks the file as "offline" when the pattern was found on the html-page + if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: + self.offline() + + # parse the name from the site and set attribute in pyfile + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (Filename") + pyfile.name = found.group(1) + + def handleFree(self): + # parse free download url + found = re.search(self.FREE_URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + + parsed_url = found.group(1) + + if parsed_url == "": + t = datetime.datetime.today().replace(hour=1, minute=0, second=0) + datetime.timedelta( + days=1) - datetime.datetime.today() + self.setWait(t.seconds, True) + self.wait() + self.retry() + + # get download ticket and parse html + self.logDebug("PARSED_URL:" + parsed_url) + self.html = self.load(parsed_url) + + found = re.search(self.SERVER_PATTERN, self.html) + if found is None: + self.fail("Parse error (Server)") + download_url = found.group(1) + + found = re.search(self.CAPTCHA_PATTERN, self.html) + if found is None: + self.fail("Parse error (Captcha)") + captcha_url = found.group(1) + + # get and decrypt captcha + captcha = self.decryptCaptcha(captcha_url) + self.logDebug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha) + + # download the file, destination is determined by pyLoad + self.download(download_url, post={ + "captcha": captcha + }) + + # check download + check = self.checkDownload({ + "wrong_captcha": "<p>Incorrectly copied code from the image</p>" + }) + + if check == "wrong_captcha": + self.invalidCaptcha() + self.retry() + + def handlePremium(self): + found = re.search(self.FILE_CREDITS_PATTERN, self.html) + if found is None: + self.fail("Parse error (Credits)") + file_credits = int(found.group(1)) + + found = re.search(self.CREDIT_LEFT_PATTERN, self.html) + if found is None: + self.fail("Parse error (Credits left)") + credits_left = int(found.group(1)) + + self.logInfo("Premium download for %i credits" % file_credits) + self.logInfo("User %s has %i credits left" % (self.user, credits_left)) + + if file_credits > credits_left and not re.search(self.DOWNLOAD_AGAIN_PATTERN, self.html): + self.resetAccount() + + found = re.search(self.PREMIUM_URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + download_url = found.group(1) + + self.download(download_url) + + info = self.account.getAccountInfo(self.user, True) + self.logInfo("User %s has %i credits left" % (self.user, info["trafficleft"] / 1024)) + + + + diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py new file mode 100644 index 000000000..488fdcbc4 --- /dev/null +++ b/module/plugins/hoster/MultishareCz.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + try: + html = getURL(url, decode=True) + except Exception: + result.append((url, 0, 1, url)) + else: + if re.search(MultishareCz.OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(MultishareCz.FILE_INFO_PATTERN, html) + if found is not None: + name = found.group(1) + size = float(found.group(2)) + units = found.group(3) + + pow = {'KB': 1, 'MB': 2, 'GB': 3}[units] + size = int(size * 1024 ** pow) + + result.append((name, size, 2, url)) + yield result + + +class MultishareCz(Hoster): + __name__ = "MultishareCz" + __type__ = "hoster" + __pattern__ = r"http://(\w*\.)?multishare.cz/stahnout/.*" + __version__ = "0.2" + __description__ = """MultiShare.cz""" + __author_name__ = ("zoidberg") + + FILE_ID_PATTERN = r'/stahnout/(\d+)/' + FILE_INFO_PATTERN = r'<ul class="no-padding"><li>N�zev: <strong>([^<]+)</strong></li><li>Velikost: <strong>([^&]+) ([^<]+)</strong>' + OFFLINE_PATTERN = r'<h1>St�hnout soubor</h1><p><strong>Po.adovan� soubor neexistuje.</strong></p>' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + if re.search(self.OFFLINE_PATTERN, self.html) is not None: + self.offline() + + found = re.search(self.FILE_ID_PATTERN, pyfile.url) + if found is None: + self.fail("Parse error (ID)") + file_id = found.group(1) + + found = re.search(self.FILE_INFO_PATTERN, self.html) + if found is None: + self.fail("Parse error (NAME)") + pyfile.name = found.group(1) + + self.download("http://www.multishare.cz/html/download_free.php", get={ + "ID": file_id + }) diff --git a/module/plugins/hoster/NahrajCz.py b/module/plugins/hoster/NahrajCz.py new file mode 100644 index 000000000..634c1af7d --- /dev/null +++ b/module/plugins/hoster/NahrajCz.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster + +class NahrajCz(Hoster): + __name__ = "NahrajCz" + __type__ = "hoster" + __pattern__ = r"http://.*nahraj.cz/content/download/.*" + __version__ = "0.2" + __description__ = """nahraj.cz""" + __author_name__ = ("zoidberg") + + FILE_URL_PATTERN = r'<form id="forwarder" method="post"[^>]*action="([^"]+/([^/"]+))">' + SUBMIT_PATTERN = r'<input id="submit" type="submit" value="([^"]+)" name="submit"/>' + #ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + self.html = self.load(pyfile.url) + + found = re.search(self.FILE_URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + parsed_url = found.group(1) + pyfile.name = found.group(2) + + found = re.search(self.SUBMIT_PATTERN, self.html) + if found is None: + self.fail("Parse error (SUBMIT)") + submit = found.group(1) + + self.download(parsed_url, disposition=True, post={ + "submit": submit + }) +
\ No newline at end of file diff --git a/module/plugins/hoster/PrzeklejPl.py b/module/plugins/hoster/PrzeklejPl.py new file mode 100644 index 000000000..e97fb551e --- /dev/null +++ b/module/plugins/hoster/PrzeklejPl.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster + +class PrzeklejPl(Hoster): + __name__ = "PrzeklejPl" + __type__ = "hoster" + __pattern__ = r"http://.*przeklej.pl/plik/.*" + __version__ = "0.1" + __description__ = """przeklej.pl""" + __author_name__ = ("zoidberg") + + FILE_URL_PATTERN = r'<a href="([^"]+)" title="Pobierz plik">([^<]+)</a>' + + #ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>' + + def setup(self): + self.multiDL = True + + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + found = re.search(self.FILE_URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + parsed_url = found.group(1) + pyfile.name = found.group(2) + + self.download("http://www.przeklej.pl" + parsed_url) +
\ No newline at end of file diff --git a/module/plugins/hoster/QuickshareCz.py b/module/plugins/hoster/QuickshareCz.py new file mode 100644 index 000000000..fe8d6febe --- /dev/null +++ b/module/plugins/hoster/QuickshareCz.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + try: + html = getURL(url, decode=True) + + if re.search(QuickshareCz.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(QuickshareCz.VAR_PATTERN, html) + if found is not None: + name = found.group('ID3') + + found = re.search(QuickshareCz.FILE_SIZE_PATTERN, html) + if found is not None: + size = float(found.group(1)) + units = found.group(2) + + pow = {'kB': 1, 'MB': 2, 'GB': 3}[units] + size = int(size * 1024 ** pow) + + result.append((name, size, 2, url)) + except: + result.append((url, 0, 1, url)) + + yield result + + +class QuickshareCz(Hoster): + __name__ = "QuickshareCz" + __type__ = "hoster" + __pattern__ = r"http://.*quickshare.cz/stahnout-soubor/.*" + __version__ = "0.5" + __description__ = """Quickshare.cz""" + __author_name__ = ("zoidberg") + + VAR_PATTERN = r"var ID1 = '(?P<ID1>[^']+)';var ID2 = '(?P<ID2>[^']+)';var ID3 = '(?P<ID3>[^']+)';var ID4 = '(?P<ID4>[^']+)';var ID5 = '[^']*';var UU_prihlasen = '[^']*';var UU_kredit = [^;]*;var velikost = [^;]*;var kredit_odecet = [^;]*;var CaptchaText = '(?P<CaptchaText>[^']+)';var server = '(?P<Server>[^']+)';" + FILE_OFFLINE_PATTERN = r'<script type="text/javascript">location.href=\'/chyba\';</script>' + FILE_SIZE_PATTERN = r'<br>Velikost: <strong>([0-9.]+)</strong>\s*(KB|MB|GB)<br>' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + self.html = self.load(pyfile.url) + + # marks the file as "offline" when the pattern was found on the html-page + if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: + self.offline() + + # 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.fail("Parser error") + # unreachable: pyfile.name = unicode(parsed_vars.group('ID3'), 'utf-8') + + # 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 %" + }) + + if check == "no_slots": + self.retry(5, 600, "No free slots") diff --git a/module/plugins/hoster/SpeedfileCz.py b/module/plugins/hoster/SpeedfileCz.py new file mode 100644 index 000000000..0c5010b15 --- /dev/null +++ b/module/plugins/hoster/SpeedfileCz.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url, decode=True) + if re.search(SpeedfileCz.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(SpeedfileCz.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + result.append((name, 0, 2, url)) + yield result + + +class SpeedfileCz(Hoster): + __name__ = "SpeedFileCz" + __type__ = "hoster" + __pattern__ = r"http://speedfile.cz/.*" + __version__ = "0.3" + __description__ = """speedfile.cz""" + __author_name__ = ("zoidberg") + + FILE_NAME_PATTERN = r'<meta property="og:title" content="([^"]+)" />' + URL_PATTERN = r'<a id="request" class="caps" href="([^"]+)" rel="nofollow">' + FILE_OFFLINE_PATTERN = r'<title>Speedfile \| 404' + WAIT_PATTERN = r'"requestedAt":(\d+),"allowedAt":(\d+),"adUri"' + + 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): + self.offline() + + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (NAME)") + pyfile.name = found.group(1) + + found = re.search(self.URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + download_url = "http://speedfile.cz/" + found.group(1) + + self.html = self.load(download_url) + self.logDebug(self.html) + found = re.search(self.WAIT_PATTERN, self.html) + if found is None: + self.fail("Parse error (WAIT)") + self.setWait(int(found.group(2)) - int(found.group(1))) + self.wait() + + self.download(download_url) diff --git a/module/plugins/hoster/StahnuTo.py b/module/plugins/hoster/StahnuTo.py new file mode 100644 index 000000000..0413853dd --- /dev/null +++ b/module/plugins/hoster/StahnuTo.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL("http://stahnu.to/?file=" + re.search(StahnuTo.__pattern__, url).group(3), decode=True) + if re.search(StahnuTo.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(StahnuTo.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + + found = re.search(StahnuTo.FILE_SIZE_PATTERN, html) + if found is not None: + size = float(found.group(1)) + units = found.group(2) + + pow = {'kB': 1, 'Mb': 2, 'Gb': 3}[units] + size = int(size * 1024 ** pow) + + result.append((name, size, 2, url)) + yield result + + +class StahnuTo(Hoster): + __name__ = "StahnuTo" + __type__ = "hoster" + __pattern__ = r"http://(\w*\.)?stahnu.to/(files/get/|.*\?file=)([^/]+).*" + __version__ = "0.1" + __description__ = """stahnu.to""" + __author_name__ = ("zoidberg") + + FILE_NAME_PATTERN = r"<div class='nadpis-01'><h2>([^<]+)</h2></div>" + FILE_SIZE_PATTERN = r'<td>Velikost souboru<br /><span>([^<]+)\s*(kb|Mb|Gb)</span></td>' + FILE_OFFLINE_PATTERN = r'<!-- Obsah - start -->\s*<!-- Obsah - end -->' + #FILE_OFFLINE_PATTERN = r'<h2 align="center">Tento soubor neexistuje nebo byl odstraněn! </h2>' + CAPTCHA_PATTERN = r'<img src="captcha/captcha.php" id="captcha" /></td>' + + + def setup(self): + self.multiDL = True + + def process(self, pyfile): + found = re.search(self.__pattern__, pyfile.url) + if found is None: + self.fail("Wrong URL") + file_id = found.group(3) + + self.html = self.load("http://stahnu.to/?file=" + file_id, decode=True) + + if re.search(self.FILE_OFFLINE_PATTERN, self.html): + self.offline() + + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (NAME)") + pyfile.name = found.group(1) + + """ + captcha = self.decryptCaptcha("http://stahnu.to/captcha/captcha.php", cookies=True) + + self.html = self.load("http://stahnu.to/?file=" + file_id, cookies=True, post={ + if re.search(self.CAPTCHA_PATTERN, self.html) is not None: + self.invalidCaptcha() + self.retry() + + """ + + self.download("http://stahnu.to/files/gen/" + file_id, post={ + "file": file_id, + "user": "Anonym", + "commenttext": "" + }) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py new file mode 100644 index 000000000..b16240ab7 --- /dev/null +++ b/module/plugins/hoster/UlozTo.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + try: + html = getURL(url, decode=True) + + if re.search(UlozTo.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + name = '' + found = re.search(UlozTo.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + else: + found = re.search(UlozTo.LIVE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + + if name: + found = re.search(UlozTo.FILE_SIZE_PATTERN, html) + if found is not None: + size = float(found.group(1)) + units = found.group(2) + + pow = {'kB': 1, 'MB': 2, 'GB': 3}[units] + size = int(size * 1024 ** pow) + + result.append((name, size, 2, url)) + except Exception: + result.append((url, 0, 1, url)) + + yield result + + +class UlozTo(Hoster): + __name__ = "UlozTo" + __type__ = "hoster" + __pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/.*" + __version__ = "0.7" + __description__ = """uloz.to""" + __config__ = [("reuseCaptcha", "bool", "Reuse captcha", "True"), + ("captchaUser", "str", "captcha_user", ""), + ("captchaNb", "str", "captcha_nb", "")] + __author_name__ = ("zoidberg") + + FILE_URL_PATTERN = r'<form name="dwn" action="([^"]+)"' + FILE_NAME_PATTERN = r'<h2 class="nadpis" style="margin-left:196px;"><a href="[^"]+">([^<]+)</a></h2>' + CAPTCHA_PATTERN = r'<img style=".*src="([^"]+)" alt="Captcha" class="captcha"' + CAPTCHA_NB_PATTERN = r'<input class="captcha_nb" type="hidden" name="captcha_nb" value="([0-9]+)" >' + FILE_OFFLINE_PATTERN = r'href="http://www.ulozto.net/(neexistujici|smazano)/\?lg=en&' + PASSWD_PATTERN = r'<input type="password" class="text" name="file_password" id="frmfilepasswordForm-file_password" />' + LIVE_URL_PATTERN = r'<div id="flashplayer"[^>]*>\s*<a href="([^"]+)"' + LIVE_NAME_PATTERN = r'<a share_url="[^&]*&t=([^"]+)"' + FILE_SIZE_PATTERN = r'<div class="info_velikost" style="top:-55px;">\s*<div>[^<]*\s+([0-9.]+)\s(kB|MB|GB)\s*</div>\s*</div>' + VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">' + + def setup(self): + self.multiDL = False + + def process(self, pyfile): + self.html = self.load(pyfile.url, decode=True) + + #marks the file as "offline" when the pattern was found on the html-page + if re.search(self.FILE_OFFLINE_PATTERN, self.html): + self.offline() + + if re.search(self.VIPLINK_PATTERN, self.html): + self.html = self.load(pyfile.url, get={"disclaimer": "1"}) + + found = re.search(self.LIVE_URL_PATTERN, self.html) + if found is not None: + # Uloz.to LIVE + parsed_url = found.group(1) + self.logDebug("LIVE URL:" + parsed_url) + + found = re.search(self.LIVE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (LIVE_NAME)") + pyfile.name = found.group(1) + self.log.debug("LIVE NAME:" + pyfile.name) + + self.download(parsed_url) + else: + # Uloz.to DATA + # parse the name from the site and set attribute in pyfile + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (FILENAME)") + pyfile.name = found.group(1) + self.log.debug("PARSED_NAME:" + pyfile.name) + + found = re.search(self.FILE_URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + parsed_url = found.group(1) + self.log.debug("PARSED_URL:" + parsed_url) + + # get and decrypt captcha + reuse_captcha = self.getConfig("reuseCaptcha") + captcha = self.getConfig("captchaUser") + captcha_nb = self.getConfig("captchaNb") + captcha_url = "DUMMY" + + if not reuse_captcha or not captcha or not captcha_nb: + found = re.search(self.CAPTCHA_PATTERN, self.html) + if found is None: + self.fail("Parse error (CAPTCHA)") + captcha_url = found.group(1) + captcha = self.decryptCaptcha(captcha_url) + found = re.search(self.CAPTCHA_NB_PATTERN, self.html) + if found is None: + self.fail("Parse error (CAPTCHA_NB)") + captcha_nb = found.group(1) + self.log.debug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha + ' CAPTCHA_NB:' + captcha_nb) + + # download the file, destination is determined by pyLoad + self.download(parsed_url, post={ + "captcha_user": captcha, + "captcha_nb": captcha_nb + }) + + check = self.checkDownload({ + "wrong_captcha": re.compile(self.CAPTCHA_PATTERN), + "offline": re.compile(self.FILE_OFFLINE_PATTERN), + "passwd": self.PASSWD_PATTERN + }) + + if check == "wrong_captcha": + if reuse_captcha: + self.setConfig("captchaUser", "") + self.setConfig("captchaNb", "") + self.invalidCaptcha() + self.retry(reason="Wrong captcha code") + elif check == "offline": + self.offline() + elif check == "passwd": + self.fail("Password protected") + + if reuse_captcha: + self.setConfig("captchaUser", captcha) + self.setConfig("captchaNb", captcha_nb) +
\ No newline at end of file diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py new file mode 100644 index 000000000..b8ec0df55 --- /dev/null +++ b/module/plugins/hoster/UloziskoSk.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: zoidberg +""" + +import re +from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL + +def getInfo(urls): + result = [] + + for url in urls: + html = getURL(url, decode=True) + if re.search(UloziskoSk.FILE_OFFLINE_PATTERN, html): + # File offline + result.append((url, 0, 1, url)) + else: + # Get file info + found = re.search(UloziskoSk.FILE_NAME_PATTERN, html) + if found is not None: + name = found.group(1) + result.append((name, 0, 2, url)) + yield result + + +class UloziskoSk(Hoster): + __name__ = "UloziskoSk" + __type__ = "hoster" + __pattern__ = r"http://(\w*\.)?ulozisko.sk/.*" + __version__ = "0.1" + __description__ = """Ulozisko.sk""" + __author_name__ = ("zoidberg") + + URL_PATTERN = r'<form name = "formular" action = "([^"]+)" method = "post">' + ID_PATTERN = r'<input type = "hidden" name = "id" value = "([^"]+)" />' + FILE_NAME_PATTERN = r'<input type = "hidden" name = "name" value = "([^"]+)" />' + CAPTCHA_PATTERN = r'<img src="(/obrazky/obrazky.php\?fid=[^"]+)" alt="" />' + FILE_OFFLINE_PATTERN = r'<span class = "red">Zadan� s�bor neexistuje z jedn�ho z nasleduj�cich d�vodov:</span>' + + 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() + + found = re.search(self.URL_PATTERN, self.html) + if found is None: + self.fail("Parse error (URL)") + parsed_url = 'http://www.ulozisko.sk' + found.group(1) + + found = re.search(self.FILE_NAME_PATTERN, self.html) + if found is None: + self.fail("Parse error (FILENAME)") + pyfile.name = found.group(1) + + found = re.search(self.ID_PATTERN, self.html) + if found is None: + self.fail("Parse error (ID)") + id = found.group(1) + + self.logDebug('URL:' + parsed_url + ' NAME:' + pyfile.name + ' ID:' + id) + + found = re.search(self.CAPTCHA_PATTERN, self.html) + if found is None: + self.fail("Parse error (CAPTCHA)") + captcha_url = 'http://www.ulozisko.sk' + found.group(1) + + captcha = self.decryptCaptcha(captcha_url, cookies=True) + + self.logDebug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha) + + self.download(parsed_url, post={ + "antispam": captcha, + "id": id, + "name": pyfile.name, + "but": "++++STIAHNI+S%DABOR++++" + }) +
\ No newline at end of file |