summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/Dereferer.py35
-rw-r--r--module/plugins/crypter/DontKnowMe.py17
-rw-r--r--module/plugins/crypter/FilecryptCc.py4
-rw-r--r--module/plugins/crypter/FurLy.py24
-rw-r--r--module/plugins/crypter/GooGl.py10
-rw-r--r--module/plugins/crypter/LinkSaveIn.py6
-rw-r--r--module/plugins/crypter/MegaCoNzFolder.py4
-rw-r--r--module/plugins/crypter/NCryptIn.py4
-rw-r--r--module/plugins/crypter/SafelinkingNet.py4
-rw-r--r--module/plugins/crypter/TinyurlCom.py23
-rw-r--r--module/plugins/crypter/XFileSharingProFolder.py4
11 files changed, 95 insertions, 40 deletions
diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py
index 8427c1540..85b84a242 100644
--- a/module/plugins/crypter/Dereferer.py
+++ b/module/plugins/crypter/Dereferer.py
@@ -1,17 +1,42 @@
# -*- coding: utf-8 -*-
-from module.plugins.internal.SimpleDereferer import SimpleDereferer
+import re
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
-class Dereferer(SimpleDereferer):
+
+class Dereferer(SimpleCrypter):
__name__ = "Dereferer"
__type__ = "crypter"
- __version__ = "0.11"
+ __version__ = "0.14"
- __pattern__ = r'https?://([^/]+)/.*?(?P<LINK>(ht|f)tps?(://|%3A%2F%2F).+)'
+ __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/.*?(?P<LINK>(?:ht|f)tps?://.+)'
__config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
__description__ = """Crypter for dereferers"""
__license__ = "GPLv3"
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ HOSTER_DOMAIN = None
+ HOSTER_NAME = None
+
+
+ def _log(self, type, args):
+ msg = " | ".join(str(a).strip() for a in args if a)
+ logger = getattr(self.log, type)
+ logger("%s: %s: %s" % (self.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper())))
+
+
+ def init(self):
+ super(Dereferer, self).init()
+
+ self.__pattern__ = self.core.pluginManager.crypterPlugins[self.__name__]['pattern'] #@TODO: Recheck in 0.4.10
+
+ self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group("DOMAIN").lower()
+ self.HOSTER_NAME = "".join(part.capitalize() for part in re.split(r'(\.|\d+)', self.HOSTER_DOMAIN) if part != '.')
+
+
+ def getLinks(self):
+ return [re.match(self.__pattern__, self.pyfile.url).group('LINK').strip()]
diff --git a/module/plugins/crypter/DontKnowMe.py b/module/plugins/crypter/DontKnowMe.py
deleted file mode 100644
index e56751972..000000000
--- a/module/plugins/crypter/DontKnowMe.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- coding: utf-8 -*-
-
-from module.plugins.internal.SimpleDereferer import SimpleDereferer
-
-
-class DontKnowMe(SimpleDereferer):
- __name__ = "DontKnowMe"
- __type__ = "crypter"
- __version__ = "0.11"
-
- __pattern__ = r'http://(?:www\.)?dontknow\.me/at/\?(?P<LINK>.+)'
- __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
- ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
-
- __description__ = """DontKnow.me decrypter plugin"""
- __license__ = "GPLv3"
- __authors__ = [("selaux", "")]
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py
index a1a94b6f6..4d2b42f90 100644
--- a/module/plugins/crypter/FilecryptCc.py
+++ b/module/plugins/crypter/FilecryptCc.py
@@ -10,13 +10,13 @@ import urlparse
from Crypto.Cipher import AES
from module.plugins.Crypter import Crypter
-from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.ReCaptcha import ReCaptcha
class FilecryptCc(Crypter):
__name__ = "FilecryptCc"
__type__ = "crypter"
- __version__ = "0.14"
+ __version__ = "0.15"
__pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+'
diff --git a/module/plugins/crypter/FurLy.py b/module/plugins/crypter/FurLy.py
new file mode 100644
index 000000000..b8e9332e2
--- /dev/null
+++ b/module/plugins/crypter/FurLy.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
+
+
+class FurLy(SimpleCrypter):
+ __name__ = "FurLy"
+ __type__ = "crypter"
+ __version__ = "0.01"
+
+ __pattern__ = r'http://(?:www\.)?fur\.ly/(\d/)?\w+'
+
+ __description__ = """Fur.ly decrypter plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ URL_REPLACEMENTS = [(r'fur\.ly/', r'fur\.ly/bar/')]
+
+ LINK_PATTERN = r'urls\[\d+\] = "(.+?)"'
+ OFFLINE_PATTERN = r'var output;\s*var total'
+
+
+getInfo = create_getInfo(FurLy)
diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py
index 30e193b9d..b36e22884 100644
--- a/module/plugins/crypter/GooGl.py
+++ b/module/plugins/crypter/GooGl.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
-from module.plugins.internal.SimpleDereferer import SimpleDereferer, create_getInfo
+from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
from module.common.json_layer import json_loads
-class GooGl(SimpleDereferer):
+class GooGl(SimpleCrypter):
__name__ = "GooGl"
__type__ = "crypter"
- __version__ = "0.02"
+ __version__ = "0.03"
__pattern__ = r'https?://(?:www\.)?goo\.gl/([a-zA-Z]+/)?\w+'
@@ -22,11 +22,11 @@ class GooGl(SimpleDereferer):
OFFLINE_PATTERN = r'has been disabled|does not exist'
- def getLink(self):
+ def getLinks(self):
rep = self.load(self.API_URL, get={'shortUrl': self.pyfile.url})
self.logDebug("JSON data: " + rep)
rep = json_loads(rep)
- return rep['longUrl'] if "longUrl" in rep else None
+ return [rep['longUrl']] if "longUrl" in rep else None
getInfo = create_getInfo(GooGl)
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index 95652096d..dce74b689 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
-from module.plugins.internal.SimpleDereferer import SimpleDereferer, create_getInfo
+from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
-class LinkSaveIn(SimpleDereferer):
+class LinkSaveIn(SimpleCrypter):
__name__ = "LinkSaveIn"
__type__ = "crypter"
- __version__ = "2.04"
+ __version__ = "2.05"
__pattern__ = r'https?://(?:www\.)?linksave\.in/\w+'
__config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
diff --git a/module/plugins/crypter/MegaCoNzFolder.py b/module/plugins/crypter/MegaCoNzFolder.py
index bd135ac5f..0c6f224a4 100644
--- a/module/plugins/crypter/MegaCoNzFolder.py
+++ b/module/plugins/crypter/MegaCoNzFolder.py
@@ -10,7 +10,7 @@ class MegaCoNzFolder(Crypter):
__type__ = "crypter"
__version__ = "0.04"
- __pattern__ = r'(?:https?://(?:www\.)?mega\.co\.nz/|mega:|chrome:.+?)#F!(?P<ID>[\w^_]+)!(?P<KEY>[\w,\\-]+)'
+ __pattern__ = r'(?:https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#F!(?P<ID>[\w^_]+)!(?P<KEY>[\w,\\-]+)'
__config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]
@@ -26,7 +26,7 @@ class MegaCoNzFolder(Crypter):
def decrypt(self, pyfile):
url = "https://mega.co.nz/#F!%s!%s" % re.match(self.__pattern__, pyfile.url).groups()
self.html = self.load("http://rapidgen.org/linkfinder", post={'linklisturl': url})
- self.urls = re.findall(r'(https://mega.co.nz/#N!.+?)<', self.html)
+ self.urls = re.findall(r'(https://mega(\.co)?\.nz/#N!.+?)<', self.html)
if not self.urls: #@TODO: Remove in 0.4.10
self.fail(_("No link grabbed"))
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 8ceb9d3c8..593e9b506 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -6,13 +6,13 @@ import re
from Crypto.Cipher import AES
from module.plugins.Crypter import Crypter
-from module.plugins.internal.CaptchaService import ReCaptcha
+from module.plugins.internal.ReCaptcha import ReCaptcha
class NCryptIn(Crypter):
__name__ = "NCryptIn"
__type__ = "crypter"
- __version__ = "1.34"
+ __version__ = "1.35"
__pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<TYPE>folder|link|frame)-([^/\?]+)'
__config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py
index 7f0915065..5d822af11 100644
--- a/module/plugins/crypter/SafelinkingNet.py
+++ b/module/plugins/crypter/SafelinkingNet.py
@@ -6,13 +6,13 @@ from BeautifulSoup import BeautifulSoup
from module.common.json_layer import json_loads
from module.plugins.Crypter import Crypter
-from module.plugins.internal.CaptchaService import SolveMedia
+from module.plugins.internal.SolveMedia import SolveMedia
class SafelinkingNet(Crypter):
__name__ = "SafelinkingNet"
__type__ = "crypter"
- __version__ = "0.14"
+ __version__ = "0.15"
__pattern__ = r'https?://(?:www\.)?safelinking\.net/([pd])/\w+'
__config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
diff --git a/module/plugins/crypter/TinyurlCom.py b/module/plugins/crypter/TinyurlCom.py
new file mode 100644
index 000000000..e2cf50358
--- /dev/null
+++ b/module/plugins/crypter/TinyurlCom.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+
+from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
+
+
+class TinyurlCom(SimpleCrypter):
+ __name__ = "TinyurlCom"
+ __type__ = "crypter"
+ __version__ = "0.02"
+
+ __pattern__ = r'https?://(?:www\.)?(preview\.)?tinyurl\.com/[\w-]+'
+
+ __description__ = """Tinyurl.com decrypter plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+
+
+ URL_REPLACEMENTS = [(r'preview\.', r'')]
+
+ OFFLINE_PATTERN = r">Error: Unable to find site's URL to redirect to"
+
+
+getInfo = create_getInfo(TinyurlCom)
diff --git a/module/plugins/crypter/XFileSharingProFolder.py b/module/plugins/crypter/XFileSharingProFolder.py
index 8b850271d..2e1a2f022 100644
--- a/module/plugins/crypter/XFileSharingProFolder.py
+++ b/module/plugins/crypter/XFileSharingProFolder.py
@@ -8,9 +8,9 @@ from module.plugins.internal.XFSCrypter import XFSCrypter, create_getInfo
class XFileSharingProFolder(XFSCrypter):
__name__ = "XFileSharingProFolder"
__type__ = "crypter"
- __version__ = "0.05"
+ __version__ = "0.06"
- __pattern__ = r'^unmatchable$'
+ __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+'
__config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True),
("subfolder_per_pack", "bool", "Create a subfolder for each package", True)]