summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-12-01 21:45:11 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-12-01 21:45:11 +0100
commitf5224f7a581eb5750a6ab9de2302ed749fb77540 (patch)
tree58078b3de04ce812b200e20157a3ab9351208748 /module/plugins/internal
parentupdate hellspy.cz, add bayfiles.com (diff)
downloadpyload-f5224f7a581eb5750a6ab9de2302ed749fb77540.tar.xz
megaupload decode file info, megaupload/depositfiles folders
Diffstat (limited to 'module/plugins/internal')
-rw-r--r--module/plugins/internal/SimpleCrypter.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py
new file mode 100644
index 000000000..69798bc0a
--- /dev/null
+++ b/module/plugins/internal/SimpleCrypter.py
@@ -0,0 +1,44 @@
+# -*- 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/>.
+
+ @author: zoidberg
+"""
+
+from re import findall
+from module.plugins.Crypter import Crypter
+
+class SimpleCrypter(Crypter):
+ __name__ = "SimpleCrypter"
+ __version__ = "0.01"
+ __pattern__ = None
+ __type__ = "crypter"
+ __description__ = """Base crypter plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ def init(self):
+ self.url = self.pyfile.url
+
+ def decrypt(self, pyfile):
+ self.html = self.load(self.url)
+
+ new_links = []
+ new_links.extend(findall(self.LINK_PATTERN, self.html))
+
+ if new_links:
+ self.core.files.addLinks(new_links, self.pyfile.package().id)
+ else:
+ self.fail('Could not extract any links') \ No newline at end of file