diff options
author | fragonib <devnull@localhost> | 2011-06-05 16:24:21 +0200 |
---|---|---|
committer | fragonib <devnull@localhost> | 2011-06-05 16:24:21 +0200 |
commit | 2c3b64a41b48f52cc721679cb108dd378cfbaf2b (patch) | |
tree | 8b626eee93fa310dbccc1562225272eac476222e /module | |
parent | closed #323 (diff) | |
download | pyload-2c3b64a41b48f52cc721679cb108dd378cfbaf2b.tar.xz |
Use new logging functions
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/crypter/LinkSaveIn.py | 36 | ||||
-rw-r--r-- | module/plugins/crypter/NCryptIn.py | 40 | ||||
-rw-r--r-- | module/plugins/crypter/NetfolderIn.py | 14 | ||||
-rw-r--r-- | module/plugins/crypter/RelinkUs.py | 20 | ||||
-rw-r--r-- | module/plugins/crypter/ShareLinksBiz.py | 46 | ||||
-rw-r--r-- | module/plugins/hoster/BitshareCom.py | 25 | ||||
-rw-r--r-- | module/plugins/hoster/OneFichierCom.py | 13 | ||||
-rw-r--r-- | module/plugins/hoster/UploadStationCom.py | 20 |
8 files changed, 106 insertions, 108 deletions
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py index 5a72b750a..ac64acf3e 100644 --- a/module/plugins/crypter/LinkSaveIn.py +++ b/module/plugins/crypter/LinkSaveIn.py @@ -64,24 +64,24 @@ class LinkSaveIn(Crypter): def isOnline(self):
if "<big>Error 404 - Folder not found!</big>" in self.html:
- self.log.debug("%s: File not found" % self.__name__)
+ self.logDebug("File not found")
return False
return True
def isPasswordProtected(self):
if re.search(r'''<input.*?type="password"''', self.html):
- self.log.debug("%s: Links are password protected" % self.__name__)
+ self.logDebug("Links are password protected")
return True
def isCaptchaProtected(self):
if "<b>Captcha:</b>" in self.html:
- self.log.debug("%s: Links are captcha protected" % self.__name__)
+ self.logDebug("Links are captcha protected")
return True
return False
def unlockPasswordProtection(self):
password = self.getPassword()
- self.log.debug("%s: Submitting password [%s] for protected links" % (self.__name__, password))
+ self.logDebug("Submitting password [%s] for protected links" % password)
post = {"id": self.fileid, "besucherpasswort": password, 'login': 'submit'}
self.html = self.load(self.pyfile.url, post=post)
@@ -94,17 +94,17 @@ class LinkSaveIn(Crypter): def getPackageInfo(self):
name = self.pyfile.package().name
folder = self.pyfile.package().folder
- self.log.debug("%s: Defaulting to pyfile name [%s] and folder [%s] for package" % (self.__name__, name, folder))
+ self.logDebug("Defaulting to pyfile name [%s] and folder [%s] for package" % (name, folder))
return name, folder
def handleErrors(self):
if "The visitorpassword you have entered is wrong" in self.html:
- self.log.debug("%s: Incorrect password, please set right password on 'Edit package' form and retry" % self.__name__)
+ self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry")
self.fail("Incorrect password, please set right password on 'Edit package' form and retry")
if self.captcha:
if "Wrong code. Please retry" in self.html:
- self.log.debug("%s: Invalid captcha, retrying" % self.__name__)
+ self.logDebug("Invalid captcha, retrying")
self.invalidCaptcha()
self.retry()
else:
@@ -112,36 +112,36 @@ class LinkSaveIn(Crypter): def handleWebLinks(self):
package_links = []
- self.log.debug("%s: Handling Web links" % self.__name__)
+ self.logDebug("Handling Web links")
#@TODO: Gather paginated web links
pattern = r'<a href="http://linksave\.in/(\w{43})"'
ids = re.findall(pattern, self.html)
- self.log.debug("%s: Decrypting %d Web links" % (self.__name__, len(ids)))
+ self.logDebug("Decrypting %d Web links" % len(ids))
for i, id in enumerate(ids):
try:
webLink = "http://linksave.in/%s" % id
- self.log.debug("%s: Decrypting Web link %d, %s" % (self.__name__, i+1, webLink))
+ self.logDebug("Decrypting Web link %d, %s" % (i+1, webLink))
fwLink = "http://linksave.in/fw-%s" % id
response = self.load(fwLink)
jscode = re.findall(r'<script type="text/javascript">(.*)</script>', response)[-1]
jseval = self.js.eval("document = { write: function(e) { return e; } }; %s" % jscode)
dlLink = re.search(r'http://linksave\.in/dl-\w+', jseval).group(0)
- self.log.debug("%s: JsEngine returns value [%s] for redirection link" % (self.__name__, dlLink))
+ self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink)
response = self.load(dlLink)
link = unescape(re.search(r'<iframe src="(.+?)"', response).group(1))
package_links.append(link)
except Exception, detail:
- self.log.debug("%s: Error decrypting Web link %s, %s" % (self.__name__, webLink, detail))
+ self.logDebug("Error decrypting Web link %s, %s" % (webLink, detail))
return package_links
def handleContainers(self):
package_links = []
- self.log.debug("%s: Handling Container links" % self.__name__)
+ self.logDebug("Handling Container links")
pattern = r"\('(?:rsdf|ccf|dlc)_link'\).href=unescape\('(.*?\.(?:rsdf|ccf|dlc))'\)"
containersLinks = re.findall(pattern, self.html)
- self.log.debug("%s: Decrypting %d Container links" % (self.__name__, len(containersLinks)))
+ self.logDebug("Decrypting %d Container links" % len(containersLinks))
for containerLink in containersLinks:
link = "http://linksave.in/%s" % unescape(containerLink)
package_links.append(link)
@@ -149,7 +149,7 @@ class LinkSaveIn(Crypter): def handleCNL2(self):
package_links = []
- self.log.debug("%s: Handling CNL2 links" % self.__name__)
+ self.logDebug("Handling CNL2 links")
if 'cnl2_load' in self.html:
try:
@@ -171,14 +171,14 @@ class LinkSaveIn(Crypter): vcrypted = re.findall(crypted_re, self.html)
# Log and return
- self.log.debug("%s: Detected %d crypted blocks" % (self.__name__, len(vcrypted)))
+ self.logDebug("Detected %d crypted blocks" % len(vcrypted))
return vcrypted, vjk
def _getLinks(self, crypted, jk):
# Get key
jreturn = self.js.eval("%s f()" % jk)
- self.log.debug("%s: JsEngine returns value [%s]" % (self.__name__, jreturn))
+ self.logDebug("JsEngine returns value [%s]" % jreturn)
key = binascii.unhexlify(jreturn)
# Decode crypted
@@ -196,5 +196,5 @@ class LinkSaveIn(Crypter): links = filter(lambda x: x != "", links)
# Log and return
- self.log.debug("%s: Package has %d links" % (self.__name__, len(links)))
+ self.logDebug("Package has %d links" % len(links))
return links
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 4d9426481..a8eaac631 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -68,13 +68,13 @@ class NCryptIn(Crypter): def isOnline(self):
if "Your folder does not exist" in self.cleanedHtml:
- self.log.debug("%s: File not found" % self.__name__)
+ self.logDebug("File not found")
return False
return True
def isProtected(self):
if re.search(r'''<form.*?name.*?protected.*?>''', self.cleanedHtml):
- self.log.debug("%s: Links are protected" % self.__name__)
+ self.logDebug("Links are protected")
return True
return False
@@ -84,11 +84,11 @@ class NCryptIn(Crypter): if m is not None:
title = m[-1].strip()
name = folder = title
- self.log.debug("%s: Found name [%s] and folder [%s] in package info" % (self.__name__, name, folder))
+ self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
else:
name = self.package.name
folder = self.package.folder
- self.log.debug("%s: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (self.__name__, name, folder))
+ self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
return name, folder
def unlockProtection(self):
@@ -100,23 +100,23 @@ class NCryptIn(Crypter): # Submit package password
if "password" in form:
password = self.getPassword()
- self.log.debug("%s: Submitting password [%s] for protected links" % (self.__name__, password))
+ self.logDebug("Submitting password [%s] for protected links" % password)
postData['password'] = password
# Resolve anicaptcha
if "anicaptcha" in form:
self.captcha = True
- self.log.debug("%s: Captcha protected, resolving captcha" % self.__name__)
+ self.logDebug("Captcha protected, resolving captcha")
captchaUri = re.search(r'src="(/temp/anicaptcha/[^"]+)', form).group(1)
captcha = self.decryptCaptcha("http://ncrypt.in" + captchaUri)
- self.log.debug("%s: Captcha resolved [%s]" % (self.__name__, captcha))
+ self.logDebug("Captcha resolved [%s]" % captcha)
postData['captcha'] = captcha
# Resolve recaptcha
if "recaptcha" in form:
self.captcha = True
id = re.search(r'\?k=(.*?)"', form).group(1)
- self.log.debug("%s: Resolving ReCaptcha with key [%s]" % (self.__name__, id))
+ self.logDebug("Resolving ReCaptcha with key [%s]" % id)
recaptcha = ReCaptcha(self)
challenge, code = recaptcha.challenge(id)
postData['recaptcha_challenge_field'] = challenge
@@ -129,12 +129,12 @@ class NCryptIn(Crypter): def handleErrors(self):
if "This password is invalid!" in self.cleanedHtml:
- self.log.debug("%s: Incorrect password, please set right password on 'Edit package' form and retry" % self.__name__)
+ self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry")
self.fail("Incorrect password, please set right password on 'Edit package' form and retry")
if self.captcha:
if "The securitycheck was wrong!" in self.cleanedHtml:
- self.log.debug("%s: Invalid captcha, retrying" % self.__name__)
+ self.logDebug("Invalid captcha, retrying")
self.invalidCaptcha()
self.retry()
else:
@@ -142,28 +142,28 @@ class NCryptIn(Crypter): def handleWebLinks(self):
package_links = []
- self.log.debug("%s: Handling Web links" % self.__name__)
+ self.logDebug("Handling Web links")
pattern = r"(http://ncrypt\.in/link-.*?=)"
links = re.findall(pattern, self.html)
- self.log.debug("%s: Decrypting %d Web links" % (self.__name__, len(links)))
+ self.logDebug("Decrypting %d Web links" % len(links))
for i, link in enumerate(links):
- self.log.debug("%s: Decrypting Web link %d, %s" % (self.__name__, i+1, link))
+ self.logDebug("Decrypting Web link %d, %s" % (i+1, link))
try:
url = link.replace("link-", "frame-")
link = self.load(url, just_header=True)['location']
package_links.append(link)
except Exception, detail:
- self.log.debug("%s: Error decrypting Web link %s, %s" % (self.__name__, link, detail))
+ self.logDebug("Error decrypting Web link %s, %s" % (link, detail))
return package_links
def handleContainers(self):
package_links = []
- self.log.debug("%s: Handling Container links" % self.__name__)
+ self.logDebug("Handling Container links")
pattern = r"/container/(rsdf|dlc|ccf)/([a-z0-9]+)"
containersLinks = re.findall(pattern, self.html)
- self.log.debug("%s: Decrypting %d Container links" % (self.__name__, len(containersLinks)))
+ self.logDebug("Decrypting %d Container links" % len(containersLinks))
for containerLink in containersLinks:
link = "http://ncrypt.in/container/%s/%s.%s" % (containerLink[0], containerLink[1], containerLink[0])
package_links.append(link)
@@ -171,7 +171,7 @@ class NCryptIn(Crypter): def handleCNL2(self):
package_links = []
- self.log.debug("%s: Handling CNL2 links" % self.__name__)
+ self.logDebug("Handling CNL2 links")
if 'cnl2_output' in self.cleanedHtml:
try:
@@ -195,14 +195,14 @@ class NCryptIn(Crypter): vcrypted = re.findall(crypted_re, self.html)
# Log and return
- self.log.debug("%s: Detected %d crypted blocks" % (self.__name__, len(vcrypted)))
+ self.logDebug("Detected %d crypted blocks" % len(vcrypted))
return vcrypted, vjk
def _getLinks(self, crypted, jk):
# Get key
jreturn = self.js.eval("%s f()" % jk)
- self.log.debug("%s: JsEngine returns value [%s]" % (self.__name__, jreturn))
+ self.logDebug("JsEngine returns value [%s]" % jreturn)
key = binascii.unhexlify(jreturn)
# Decode crypted
@@ -220,5 +220,5 @@ class NCryptIn(Crypter): links = filter(lambda x: x != "", links)
# Log and return
- self.log.debug("%s: Block has %d links" % (self.__name__, len(links)))
+ self.logDebug("Block has %d links" % len(links))
return links
\ No newline at end of file diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index 3a1e4e331..c8110ef6b 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -36,7 +36,7 @@ class NetfolderIn(Crypter): def isPasswordProtected(self): if '<input type="password" name="password"' in self.html: - self.log.debug("%s: Links are password protected" % self.__name__) + self.logDebug("Links are password protected") return True return False @@ -47,19 +47,19 @@ class NetfolderIn(Crypter): m = re.match(self.__pattern__, self.pyfile.url) id = max(m.group('id1'), m.group('id2')) except AttributeError: - self.log.debug("%s: Unable to get package id from url [%s]" % (self.__name__, url)) + self.logDebug("Unable to get package id from url [%s]" % url) return url = "http://netfolder.in/folder.php?folder_id=" + id password = self.getPassword() # Submit package password post = { 'password' : password, 'save' : 'Absenden' } - self.log.debug("%s: Submitting password [%s] for protected links with id [%s]" % (self.__name__, password, id)) + self.logDebug("Submitting password [%s] for protected links with id [%s]" % (password, id)) html = self.load(url, {}, post) # Check for invalid password if '<div class="InPage_Error">' in html: - self.log.debug("%s: Incorrect password, please set right password on Edit package form and retry" % self.__name__) + self.logDebug("Incorrect password, please set right password on Edit package form and retry") return None return html @@ -70,16 +70,16 @@ class NetfolderIn(Crypter): m = re.search(title_re, self.html) if m is not None: name = folder = m.group('title') - self.log.debug("%s: Found name [%s] and folder [%s] in package info" % (self.__name__, name, folder)) + self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) return name, folder else: name = self.pyfile.package().name folder = self.pyfile.package().folder - self.log.debug("%s: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (self.__name__, name, folder)) + self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) return name, folder def getLinks(self): links = re.search(r'name="list" value="(.*?)"', self.html).group(1).split(",") - self.log.debug("%s: Package has %d links" % (self.__name__, len(links))) + self.logDebug("Package has %d links" % len(links)) return links diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 4376a8c8d..c2bc6c589 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -54,13 +54,13 @@ class RelinkUs(Crypter): def isOnline(self): if "sorry.png" in self.html: - self.log.debug("%s: File not found" % self.__name__) + self.logDebug("File not found") return False return True def isPasswordProtected(self): if "<h1>Container Protection</h1>" in self.html: - self.log.debug("%s: Links are password protected" % self.__name__) + self.logDebug("Links are password protected") return True return False @@ -72,7 +72,7 @@ class RelinkUs(Crypter): url = self.pyfile.url m = re.match(self.__pattern__, url) if m is None: - self.log.debug("%s: Unable to get package id from url [%s]" % (self.__name__, url)) + self.logDebug("Unable to get package id from url [%s]" % url) return id = m.group('id') password = self.getPassword() @@ -80,12 +80,12 @@ class RelinkUs(Crypter): # Submit package password url = "http://www.relink.us/container_password.php?id=" + id post = { '#' : '', 'password' : password, 'pw' : 'submit' } - self.log.debug("%s: Submitting password [%s] for protected links with id [%s]" % (self.__name__, password, id)) + self.logDebug("Submitting password [%s] for protected links with id [%s]" % (password, id)) html = self.load(url, {}, post) # Check for invalid password if "An error occurred!" in html: - self.log.debug("%s: Incorrect password, please set right password on Add package form and retry" % self.__name__) + self.logDebug("Incorrect password, please set right password on Add package form and retry") return None else: return html @@ -95,12 +95,12 @@ class RelinkUs(Crypter): m = re.search(title_re, self.html) if m is not None: name = folder = m.group('title') - self.log.debug("%s: Found name [%s] and folder [%s] in package info" % (self.__name__, name, folder)) + self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) return name, folder else: name = self.package.name folder = self.package.folder - self.log.debug("%s: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (self.__name__, name, folder)) + self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) return name, folder def getCipherParams(self): @@ -119,14 +119,14 @@ class RelinkUs(Crypter): crypted = vars[RelinkUs._CRYPTED_KEY_] # Log and return - self.log.debug("%s: Javascript cipher key function [%s]" % (self.__name__, jk)) + self.logDebug("Javascript cipher key function [%s]" % jk) return crypted, jk def getLinks(self, crypted, jk): # Get key jreturn = self.js.eval("%s f()" % jk) - self.log.debug("%s: JsEngine returns value key=[%s]" % (self.__name__, jreturn)) + self.logDebug("JsEngine returns value key=[%s]" % jreturn) key = binascii.unhexlify(jreturn) # Decode crypted @@ -144,5 +144,5 @@ class RelinkUs(Crypter): links = filter(lambda x: x != "", links) # Log and return - self.log.debug("%s: Package has %d links" % (self.__name__, len(links))) + self.logDebug("Package has %d links" % len(links)) return links diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index fef10b7f1..7676e9cbf 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -64,19 +64,19 @@ class ShareLinksBiz(Crypter): def isOnline(self):
if "No usable content was found" in self.html:
- self.log.debug("%s: File not found" % self.__name__)
+ self.logDebug("File not found")
return False
return True
def isPasswordProtected(self):
if re.search(r'''<form.*?id="passwordForm".*?>''', self.html):
- self.log.debug("%s: Links are protected" % self.__name__)
+ self.logDebug("Links are protected")
return True
return False
def isCaptchaProtected(self):
if '<map id="captchamap"' in self.html:
- self.log.debug("%s: Links are captcha protected" % self.__name__)
+ self.logDebug("Links are captcha protected")
return True
return False
@@ -87,27 +87,27 @@ class ShareLinksBiz(Crypter): def unlockPasswordProtection(self):
password = self.getPassword()
- self.log.debug("%s: Submitting password [%s] for protected links" % (self.__name__, password))
- post = {"password": self.package.password, 'login': 'Submit form'}
+ self.logDebug("Submitting password [%s] for protected links" % password)
+ post = {"password": password, 'login': 'Submit form'}
url = self.baseUrl + '/' + self.fileId
self.html = self.load(url, post=post)
def unlockCaptchaProtection(self):
# Get captcha map
captchaMap = self._getCaptchaMap()
- self.log.debug("%s: Captcha map with [%d] positions" % (self.__name__, len(captchaMap.keys())))
+ self.logDebug("Captcha map with [%d] positions" % len(captchaMap.keys()))
# Request user for captcha coords
m = re.search(r'<img src="/captcha.gif\?d=(.*?)&PHPSESSID=(.*?)&legend=1"', self.html)
captchaUrl = self.baseUrl + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2))
- self.log.debug("%s: Waiting user for correct position" % self.__name__)
+ self.logDebug("Waiting user for correct position")
coords = self.decryptCaptcha(captchaUrl, forceUser=True, imgtype="gif", result_type='positional')
- self.log.debug("%s: Captcha resolved, coords [%s]" % (self.__name__, str(coords)))
+ self.logDebug("Captcha resolved, coords [%s]" % str(coords))
# Resolve captcha
href = self._resolveCoords(coords, captchaMap)
if href is None:
- self.log.debug("%s: Invalid captcha resolving, retrying" % self.__name__)
+ self.logDebug("Invalid captcha resolving, retrying")
self.invalidCaptcha()
self.setWait(5, False)
self.wait()
@@ -132,12 +132,12 @@ class ShareLinksBiz(Crypter): def handleErrors(self):
if "The inserted password was wrong" in self.html:
- self.log.debug("%s: Incorrect password, please set right password on 'Edit package' form and retry" % self.__name__)
+ self.logDebug("Incorrect password, please set right password on 'Edit package' form and retry")
self.fail("Incorrect password, please set right password on 'Edit package' form and retry")
if self.captcha:
if "Your choice was wrong" in self.html:
- self.log.debug("%s: Invalid captcha, retrying" % self.__name__)
+ self.logDebug("Invalid captcha, retrying")
self.invalidCaptcha()
self.setWait(5)
self.wait()
@@ -151,24 +151,24 @@ class ShareLinksBiz(Crypter): if m is not None:
title = m.group(1).strip()
name = folder = title
- self.log.debug("%s: Found name [%s] and folder [%s] in package info" % (self.__name__, name, folder))
+ self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
else:
name = self.package.name
folder = self.package.folder
- self.log.debug("%s: Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (self.__name__, name, folder))
+ self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
return name, folder
def handleWebLinks(self):
package_links = []
- self.log.debug("%s: Handling Web links" % self.__name__)
+ self.logDebug("Handling Web links")
#@TODO: Gather paginated web links
pattern = r"javascript:_get\('(.*?)', \d+, ''\)"
ids = re.findall(pattern, self.html)
- self.log.debug("%s: Decrypting %d Web links" % (self.__name__, len(ids)))
+ self.logDebug("Decrypting %d Web links" % len(ids))
for i, id in enumerate(ids):
try:
- self.log.debug("%s: Decrypting Web link %d, [%s]" % (self.__name__, i+1, id))
+ self.logDebug("Decrypting Web link %d, [%s]" % (i+1, id))
dwLink = self.baseUrl + "/get/lnk/" + id
response = self.load(dwLink)
code = re.search(r'frm/(\d+)', response).group(1)
@@ -178,19 +178,19 @@ class ShareLinksBiz(Crypter): jscode = self.js.eval("f = %s" % jscode)
jslauncher = "window=''; parent={frames:{Main:{location:{href:''}}},location:''}; %s; parent.frames.Main.location.href"
dlLink = self.js.eval(jslauncher % jscode)
- self.log.debug("%s: JsEngine returns value [%s] for redirection link" % (self.__name__, dlLink))
+ self.logDebug("JsEngine returns value [%s] for redirection link" % dlLink)
package_links.append(dlLink)
except Exception, detail:
- self.log.debug("%s: Error decrypting Web link [%s], %s" % (self.__name__, id, detail))
+ self.logDebug("Error decrypting Web link [%s], %s" % (id, detail))
return package_links
def handleContainers(self):
package_links = []
- self.log.debug("%s: Handling Container links" % self.__name__)
+ self.logDebug("Handling Container links")
pattern = r"javascript:_get\('(.*?)', 0, '(rsdf|ccf|dlc)'\)"
containersLinks = re.findall(pattern, self.html)
- self.log.debug("%s: Decrypting %d Container links" % (self.__name__, len(containersLinks)))
+ self.logDebug("Decrypting %d Container links" % len(containersLinks))
for containerLink in containersLinks:
link = "%s/get/%s/%s" % (self.baseUrl, containerLink[1], containerLink[0])
package_links.append(link)
@@ -198,7 +198,7 @@ class ShareLinksBiz(Crypter): def handleCNL2(self):
package_links = []
- self.log.debug("%s: Handling CNL2 links" % self.__name__)
+ self.logDebug("Handling CNL2 links")
if '/lib/cnl2/ClicknLoad.swf' in self.html:
try:
@@ -233,7 +233,7 @@ class ShareLinksBiz(Crypter): # Get key
jreturn = self.js.eval("%s f()" % jk)
- self.log.debug("%s: JsEngine returns value [%s]" % (self.__name__, jreturn))
+ self.logDebug("JsEngine returns value [%s]" % jreturn)
key = binascii.unhexlify(jreturn)
# Decode crypted
@@ -251,5 +251,5 @@ class ShareLinksBiz(Crypter): links = filter(lambda x: x != "", links)
# Log and return
- self.log.debug("%s: Block has %d links" % (self.__name__, len(links)))
+ self.logDebug("Block has %d links" % len(links))
return links
\ No newline at end of file diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index d5e59788a..dc9cc455c 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -67,7 +67,7 @@ class BitshareCom(Hoster): # File id m = re.match(self.__pattern__, self.pyfile.url) self.file_id = max(m.group('id1'), m.group('id2')) - self.log.debug("%s: File id is [%s]" % (self.__name__, self.file_id)) + self.logDebug("File id is [%s]" % self.file_id) # Load main page self.req.cj.setCookie(self.HOSTER_DOMAIN, "language_selection", "EN") @@ -84,7 +84,7 @@ class BitshareCom(Hoster): # Ajax file id self.ajaxid = re.search(BitshareCom.FILE_AJAXID_PATTERN, self.html).group(1) - self.log.debug("%s: File ajax id is [%s]" % (self.__name__, self.ajaxid)) + self.logDebug("File ajax id is [%s]" % self.ajaxid) # Handle free downloading self.handleFree() @@ -92,7 +92,7 @@ class BitshareCom(Hoster): def handleFree(self): # Get download info - self.log.debug("%s: Getting download info" % self.__name__) + self.logDebug("Getting download info") response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", post={"request" : "generateID", "ajaxid" : self.ajaxid}) self.handleErrors(response, ':') @@ -100,22 +100,21 @@ class BitshareCom(Hoster): filetype = parts[0] wait = int(parts[1]) captcha = int(parts[2]) - self.log.debug("%s: Download info [type: '%s', waiting: %d, captcha: %d]" % - (self.__name__, filetype, wait, captcha)) + self.logDebug("Download info [type: '%s', waiting: %d, captcha: %d]" % (filetype, wait, captcha)) # Waiting if wait > 0: - self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait)) + self.logDebug("Waiting %d seconds." % wait) self.setWait(wait, True) self.wait() # Resolve captcha if captcha == 1: - self.log.debug("%s: File is captcha protected" % self.__name__) + self.logDebug("File is captcha protected") id = re.search(BitshareCom.CAPTCHA_KEY_PATTERN, self.html).group(1) # Try up to 3 times for i in range(3): - self.log.debug("%s: Resolving ReCaptcha with key [%s], round %d" % (self.__name__, id, i+1)) + self.logDebug("Resolving ReCaptcha with key [%s], round %d" % (id, i+1)) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(id) response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", @@ -125,7 +124,7 @@ class BitshareCom(Hoster): # Get download URL - self.log.debug("%s: Getting download url" % self.__name__) + self.logDebug("Getting download url") response = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", post={"request" : "getDownloadURL", "ajaxid" : self.ajaxid}) self.handleErrors(response, '#') @@ -133,19 +132,19 @@ class BitshareCom(Hoster): # Request download URL # This may either download our file or forward us to an error page - self.log.debug("%s: Downloading file with url [%s]" % (self.__name__, url)) + self.logDebug("Downloading file with url [%s]" % url) self.download(url) def handleErrors(self, response, separator): - self.log.debug("%s: Checking response [%s]" % (self.__name__, response)) + self.logDebug("Checking response [%s]" % response) if "ERROR" in response: msg = response.split(separator)[-1] self.fail(msg) def handleCaptchaErrors(self, response): - self.log.debug("%s: Result of captcha resolving [%s]" % (self.__name__, response)) + self.logDebug("Result of captcha resolving [%s]" % response) if "SUCCESS" in response: self.correctCaptcha() return True - self.log.debug("%s: Wrong captcha" % self.__name__) + self.logDebug("Wrong captcha") self.invalidCaptcha()
\ No newline at end of file diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index bc7a4542d..3343c7c8c 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import re @@ -80,7 +79,7 @@ class OneFichierCom(Hoster): # Check for protection if self.isProtected(): password = self.getPassword() - self.log.debug("%s: Submitting password [%s]" % (self.__name__, password)) + self.logDebug("Submitting password [%s]" % password) self.download(url, post={"password" : password}) else: downloadLink = self.getDownloadLink() @@ -99,7 +98,7 @@ class OneFichierCom(Hoster): m = re.search(pattern, self.html) if m is not None: name = m.group('name').strip() - self.log.debug("%s: Got file name [%s]" % (self.__name__, name)) + self.logDebug("Got file name [%s]" % name) return name def getFileSize(self): @@ -112,12 +111,12 @@ class OneFichierCom(Hoster): except KeyError: multiplier = 1 bytes = int(size * multiplier) - self.log.debug("%s: Got file size of [%s] bytes" % (self.__name__, bytes)) + self.logDebug("Got file size of [%s] bytes" % bytes) return bytes def isProtected(self): if self.PASSWORD_PROTECTED_TOKEN in self.html: - self.log.debug("%s: Links are password protected" % self.__name__) + self.logDebug("Links are password protected") return True return False @@ -125,12 +124,12 @@ class OneFichierCom(Hoster): m = re.search(self.DOWNLOAD_LINK_PATTERN, self.html) if m is not None: url = m.group('url') - self.log.debug("%s: Got file URL [%s]" % (self.__name__, url)) + self.logDebug("Got file URL [%s]" % url) return url def handleErrors(self): if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None: - self.log.debug("%s: File not yet available." % self.__name__) + self.logDebug("File not yet available.") self.offline() def handleDownloadedFile(self): diff --git a/module/plugins/hoster/UploadStationCom.py b/module/plugins/hoster/UploadStationCom.py index a4695e30a..22af20923 100644 --- a/module/plugins/hoster/UploadStationCom.py +++ b/module/plugins/hoster/UploadStationCom.py @@ -85,20 +85,20 @@ class UploadStationCom(Hoster): # Check download
response = self.load(self.pyfile.url, post={"checkDownload" : "check"}, utf8=True)
- self.log.debug("%s: Checking download, response [%s]" % (self.__name__, response.encode('ascii', 'ignore')))
+ self.logDebug("Checking download, response [%s]" % response.encode('ascii', 'ignore'))
self.handleErrors(response)
# We got a captcha?
if UploadStationCom.CAPTCHA_PRESENT_TOKEN in self.html:
id = re.search(UploadStationCom.CAPTCHA_KEY_PATTERN, self.html).group(1)
- self.log.debug("%s: Resolving ReCaptcha with key [%s]" % (self.__name__, id))
+ self.logDebug("Resolving ReCaptcha with key [%s]" % id)
recaptcha = ReCaptcha(self)
challenge, code = recaptcha.challenge(id)
response = self.load('http://www.uploadstation.com/checkReCaptcha.php',
post={'recaptcha_challenge_field' : challenge,
'recaptcha_response_field' : code,
'recaptcha_shortencode_field' : self.fileId})
- self.log.debug("%s: Result of captcha resolving [%s]" % (self.__name__, response.encode('ascii', 'ignore')))
+ self.logDebug("Result of captcha resolving [%s]" % response.encode('ascii', 'ignore'))
self.handleCaptchaErrors(response)
# Process waiting
@@ -107,10 +107,10 @@ class UploadStationCom(Hoster): if m is not None:
wait = int(m.group(1))
if wait == 404:
- self.log.debug("No wait time returned")
+ self.logDebug("No wait time returned")
self.fail("No wait time returned")
- self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait))
+ self.logDebug("Waiting %d seconds." % wait)
self.setWait(wait + 3)
self.wait()
@@ -118,7 +118,7 @@ class UploadStationCom(Hoster): self.load(self.pyfile.url, post={"downloadLink" : "show"})
# This may either download our file or forward us to an error page
- self.log.debug("%s: Downloading file." % self.__name__)
+ self.logDebug("Downloading file.")
dl = self.download(self.pyfile.url, post={"download" : "normal"})
self.handleDownloadedFile()
@@ -131,21 +131,21 @@ class UploadStationCom(Hoster): if m is not None:
wait = int(m.group(1))
- self.log.info("%s: Time limit reached, waiting %d seconds." % (self.__name__, wait))
+ self.logInfo("Time limit reached, waiting %d seconds." % wait)
self.setWait(wait, True)
self.wait()
self.retry()
if UploadStationCom.DOWNLOAD_RESTRICTION_TOKEN in response:
wait = 720
- self.log.info("%s: Free account time limit reached, waiting %d seconds." % (self.__name__, wait))
+ self.logInfo("Free account time limit reached, waiting %d seconds." % wait)
self.setWait(wait, True)
self.wait()
self.retry()
def handleCaptchaErrors(self, response):
if UploadStationCom.CAPTCHA_WRONG_TOKEN in response:
- self.log.info("%s: Invalid captcha response, retrying." % self.__name__)
+ self.logInfo("Invalid captcha response, retrying.")
self.invalidCaptcha()
self.retry()
else:
@@ -157,7 +157,7 @@ class UploadStationCom(Hoster): wait = 720
if self.lastCheck is not None:
wait = int(self.lastCheck.group(1))
- self.log.debug("%s: Failed, you need to wait %d seconds for another download." % (self.__name__, wait))
+ self.logDebug("Failed, you need to wait %d seconds for another download." % wait)
self.setWait(wait + 3, True)
self.wait()
self.retry()
\ No newline at end of file |