summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/Dereferer.py
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-11-18 10:16:13 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-11-18 10:16:13 +0100
commite54a6d932982bf27b475fe02e42b3f75d91954e7 (patch)
treecffad098cf8a1dfdedc0f1f62ab4867488054de6 /module/plugins/crypter/Dereferer.py
parentBasePlugin - fix http auth (diff)
downloadpyload-e54a6d932982bf27b475fe02e42b3f75d91954e7.tar.xz
Dereferer plugin
Diffstat (limited to 'module/plugins/crypter/Dereferer.py')
-rw-r--r--module/plugins/crypter/Dereferer.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py
new file mode 100644
index 000000000..584835e18
--- /dev/null
+++ b/module/plugins/crypter/Dereferer.py
@@ -0,0 +1,34 @@
+# -*- 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/>.
+"""
+
+import re
+import urllib
+
+from module.plugins.Crypter import Crypter
+
+class Dereferer(Crypter):
+ __name__ = "Dereferer"
+ __type__ = "crypter"
+ __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)'
+ __version__ = "0.1"
+ __description__ = """Crypter for dereferers"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ def decrypt(self, pyfile):
+ link = re.match(self.__pattern__, self.pyfile.url).group('url')
+ self.core.files.addLinks([ urllib.unquote(link).rstrip('+') ], self.pyfile.package().id)