summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/accounts/UlozTo.py34
-rw-r--r--module/plugins/crypter/LinkdecrypterCom.py15
-rw-r--r--module/plugins/hoster/UlozTo.py192
3 files changed, 137 insertions, 104 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py
new file mode 100644
index 000000000..36e1ae342
--- /dev/null
+++ b/module/plugins/accounts/UlozTo.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.Account import Account
+import re
+
+class UlozTo(Account):
+ __name__ = "UlozTo"
+ __version__ = "0.01"
+ __type__ = "account"
+ __description__ = """uloz.to account plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ TRAFFIC_LEFT_PATTERN = r'<li class="credit"><a href="/kredit/" class="coins" title="[^"]* GB = ([^"]+) MB">'
+
+ def loadAccountInfo(self, user, req):
+ html = req.load("http://www.uloz.to/statistiky/", decode = True)
+
+ found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
+ trafficleft = int(float(found.group(1).replace(' ','').replace(',','.')) * 1000 / 1.024) if found else 0
+ self.premium = True if trafficleft else False
+
+ return {"validuntil": -1, "trafficleft": trafficleft}
+
+ def login(self, user, data, req):
+ html = req.load('http://www.uloz.to/?do=authForm-submit', post = {
+ "login": "Přihlásit",
+ "password": data['password'],
+ "trvale": "on",
+ "username": user
+ }, decode = True)
+
+ if '<ul class="error">' in html:
+ self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py
index c087c3518..93c08a5b2 100644
--- a/module/plugins/crypter/LinkdecrypterCom.py
+++ b/module/plugins/crypter/LinkdecrypterCom.py
@@ -23,7 +23,7 @@ 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|doiop\.com|ehe\.me|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|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.21"
+ __version__ = "0.22"
__description__ = """linkdecrypter.com"""
__author_name__ = ("zoidberg")
@@ -32,15 +32,18 @@ class LinkdecrypterCom(Crypter):
CAPTCHA_PATTERN = r'<img style="cursor:crosshair;" src="([^"]+)" alt="Loading CAPTCHA...">'
def decrypt(self, pyfile):
+ self.html = self.load('http://linkdecrypter.com', cookies = True)
+ phpsessid = self.req.cj.getCookie("PHPSESSID")
+
self.html = self.load('http://linkdecrypter.com', post={
"link_cache": "on",
- "links": self.pyfile.url,
+ "links" + phpsessid: self.pyfile.url,
"modo_links": "text"
- })
+ }, cookies = True)
new_links = []
captcha = ''
- passwords = self.getPassword().split()
+ passwords = self.getPassword().splitlines()
for i in range(5 + len(passwords)):
self.logDebug("Trying to decrypt #" + str(i))
@@ -78,6 +81,4 @@ class LinkdecrypterCom(Crypter):
self.correctCaptcha()
self.core.files.addLinks(new_links, self.pyfile.package().id)
else:
- self.fail('Could not extract any links')
-
-
+ self.fail('Could not extract any links') \ No newline at end of file
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py
index 53c5cd81f..9c9f502c3 100644
--- a/module/plugins/hoster/UlozTo.py
+++ b/module/plugins/hoster/UlozTo.py
@@ -18,121 +18,119 @@
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.RequestFactory import getURL
+
+def convertDecimalPrefix(m):
+ # decimal prefixes used in filesize and traffic
+ return "%s%s%s B" % (m.group(1), m.group(2).ljust(3, '0') if m.group(2) else '000', {'k': '', 'M': '000', 'G': '000000'}[m.group(3)])
class UlozTo(SimpleHoster):
__name__ = "UlozTo"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/.*"
- __version__ = "0.74"
+ __version__ = "0.80"
__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="[^"]+">(?P<N>[^<]+)</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_NAME_PATTERN = r'<a share_url="[^&]*&amp;t=(?P<N>[^"]+)"'
+ #FILE_NAME_PATTERN = r'<h2 class="nadpis" style="margin-left:196px;"><a href="[^"]+">(?P<N>[^<]+)</a></h2>'
+ FILE_SIZE_PATTERN = r'<div class="info_velikost" style="top:-55px;">\s*<div>[^<]*\s+(?P<S>[0-9.]+\s[kMG]B)\s*</div>\s*</div>'
+ FILE_SIZE_REPLACEMENTS = [('(\d+)\.?(\d+)? (\w)B', convertDecimalPrefix), (' ','')]
FILE_OFFLINE_PATTERN = r'http://www.uloz.to/(neexistujici|smazano|nenalezeno)'
+
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="[^&]*&amp;t=([^"]+)"'
- FILE_SIZE_PATTERN = r'<div class="info_velikost" style="top:-55px;">\s*<div>[^<]*\s+(?P<S>[0-9.]+)\s(?P<U>[kKMG])i?B\s*</div>\s*</div>'
- VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">'
-
- def setup(self):
- self.multiDL = False
+ VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">'
+ FREE_URL_PATTERN = r'<form name="dwn" action="([^"]+)"'
+ PREMIUM_URL_PATTERN = r'<a onclick[^>]*href="([^"]+)[^>]*class="linkVip"'
+ 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]+)" >'
def process(self, pyfile):
+ # check file online
header = self.load(pyfile.url, just_header=True)
if "location" in header:
self.logDebug('LOCATION: ' + header['location'])
if "utm_source=old" in header['location'] or re.search(self.FILE_OFFLINE_PATTERN, header['location']):
- self.offline()
-
+ self.offline()
+
self.html = self.load(pyfile.url, decode=True)
- if self.PASSWD_PATTERN in self.html:
- self.fail("Password protected link")
-
+ # password protected links
+ passwords = self.getPassword().splitlines()
+ while self.PASSWD_PATTERN in self.html:
+ if passwords:
+ password = passwords.pop(0)
+ self.logInfo("Password protected link, trying " + password)
+ self.html = self.load(pyfile.url, get = {"do": "filepasswordForm-submit"}, post={"file_password": password, "fpwdsend": 'Odeslat'}, cookies=True)
+ else:
+ self.fail("No or incorrect password")
+
+ self.file_info = self.getFileInfo()
+
+ # adult content
if re.search(self.VIPLINK_PATTERN, self.html):
self.html = self.load(pyfile.url, get={"disclaimer": "1"})
+
+ if self.premium and self.checkCredit():
+ self.handlePremium()
+ else:
+ self.handleFree()
+
+ def handleFree(self):
+ parsed_url = self.findDownloadURL(premium=False)
+
+ # get and decrypt captcha
+ captcha = self.getStorage("captchaUser")
+ captcha_nb = self.getStorage("captchaNb")
+ captcha_url = "DUMMY"
+
+ if not captcha or not captcha_nb:
+ found = re.search(self.CAPTCHA_PATTERN, self.html)
+ if not found: self.parseError("CAPTCHA")
+ captcha_url = found.group(1)
+
+ found = re.search(self.CAPTCHA_NB_PATTERN, self.html)
+ if not found: self.parseError("CAPTCHA_NB")
+ captcha_nb = found.group(1)
+
+ captcha = self.decryptCaptcha(captcha_url)
+
+ self.log.debug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha + ' CAPTCHA_NB:' + captcha_nb)
- 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)
-
-getInfo = create_getInfo(UlozTo)
-
- \ No newline at end of file
+ # download and check
+ self.download(parsed_url, post={"captcha_user": captcha, "captcha_nb": captcha_nb}, cookies=True, disposition = True)
+ self.doCheckDownload()
+
+ self.setStorage("captchaUser", captcha)
+ self.setStorage("captchaNb", captcha_nb)
+
+ def handlePremium(self):
+ parsed_url = self.findDownloadURL(premium=True)
+ self.download(parsed_url, disposition = True)
+ self.doCheckDownload()
+
+ def findDownloadURL(self, premium=False):
+ msg = "%s link" % ("Premium" if premium else "Free")
+ found = re.search(self.PREMIUM_URL_PATTERN if premium else self.FREE_URL_PATTERN, self.html)
+ if not found: self.parseError(msg)
+ parsed_url = found.group(1)
+ self.logDebug("%s: %s" % (msg, parsed_url))
+ return parsed_url
+
+ def doCheckDownload(self):
+ 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":
+ self.delStorage("captchaUser")
+ self.delStorage("captchaNb")
+ self.invalidCaptcha()
+ self.retry(reason="Wrong captcha code")
+ elif check == "offline":
+ self.offline()
+ elif check == "passwd":
+ self.fail("Wrong password")
+
+getInfo = create_getInfo(UlozTo) \ No newline at end of file