summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/DuckCryptInfo.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/crypter/DuckCryptInfo.py
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/crypter/DuckCryptInfo.py')
-rw-r--r--module/plugins/crypter/DuckCryptInfo.py44
1 files changed, 23 insertions, 21 deletions
diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py
index f44bac2e9..e7a5a59e9 100644
--- a/module/plugins/crypter/DuckCryptInfo.py
+++ b/module/plugins/crypter/DuckCryptInfo.py
@@ -1,48 +1,52 @@
# -*- coding: utf-8 -*-
import re
+
from module.lib.BeautifulSoup import BeautifulSoup
+
from module.plugins.Crypter import Crypter
class DuckCryptInfo(Crypter):
__name__ = "DuckCryptInfo"
__type__ = "crypter"
- __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)'
__version__ = "0.02"
+
+ __pattern__ = r'http://(?:www\.)?duckcrypt.info/(folder|wait|link)/(\w+)/?(\w*)'
+
__description__ = """DuckCrypt.info decrypter plugin"""
__author_name__ = "godofdream"
__author_mail__ = "soilfiction@gmail.com"
TIMER_PATTERN = r'<span id="timer">(.*)</span>'
+
def decrypt(self, pyfile):
url = pyfile.url
# seems we don't need to wait
#src = self.req.load(str(url))
- #found = re.search(self.TIMER_PATTERN, src)
- #if found:
- # self.logDebug("Sleeping for" % found.group(1))
- # self.setWait(int(found.group(1)) ,False)
- found = re.match(self.__pattern__, url)
- if not found:
+ #m = re.search(self.TIMER_PATTERN, src)
+ #if m:
+ # self.logDebug("Sleeping for" % m.group(1))
+ # self.setWait(int(m.group(1)) ,False)
+ m = re.match(self.__pattern__, url)
+ if m is None:
self.fail('Weird error in link')
- if str(found.group(1)) == "link":
+ if str(m.group(1)) == "link":
self.handleLink(url)
else:
- self.handleFolder(found)
+ self.handleFolder(m)
-
- def handleFolder(self, found):
- src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2)))
- found = re.match(self.__pattern__, src)
- self.logDebug("Redirectet to " + str(found.group(0)))
- src = self.load(str(found.group(0)))
+ def handleFolder(self, m):
+ src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2)))
+ m = re.match(self.__pattern__, src)
+ self.logDebug("Redirectet to " + str(m.group(0)))
+ src = self.load(str(m.group(0)))
soup = BeautifulSoup(src)
cryptlinks = soup.findAll("div", attrs={"class": "folderbox"})
self.logDebug("Redirectet to " + str(cryptlinks))
if not cryptlinks:
- self.fail('no links found - (Plugin out of date?)')
+ self.fail('no links m - (Plugin out of date?)')
for clink in cryptlinks:
if clink.find("a"):
self.handleLink(clink.find("a")['href'])
@@ -50,8 +54,6 @@ class DuckCryptInfo(Crypter):
def handleLink(self, url):
src = self.load(url)
soup = BeautifulSoup(src)
- link = soup.find("iframe")["src"]
- if not link:
- self.logDebug('no links found - (Plugin out of date?)')
- else:
- self.core.files.addLinks([link], self.pyfile.package().id)
+ self.urls = [soup.find("iframe")['src']]
+ if not self.urls:
+ self.logDebug('no links m - (Plugin out of date?)')