From 4a3d869e0a4ab6b9e0c2dec79f6268bd7cd1c03b Mon Sep 17 00:00:00 2001 From: GamaC0de Date: Thu, 12 May 2016 04:59:44 +0300 Subject: [New hoster] DatafileCom (fix 2461) --- module/plugins/crypter/DatafileComFolder.py | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 module/plugins/crypter/DatafileComFolder.py (limited to 'module/plugins/crypter/DatafileComFolder.py') diff --git a/module/plugins/crypter/DatafileComFolder.py b/module/plugins/crypter/DatafileComFolder.py new file mode 100644 index 000000000..a5d7d7764 --- /dev/null +++ b/module/plugins/crypter/DatafileComFolder.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.Crypter import Crypter + + +class DatafileComFolder(Crypter): + __name__ = "DatafileComFolder" + __type__ = "crypter" + __version__ = "0.01" + __status__ = "testing" + + __pattern__ = r'https?://(?:www\.)?datafile\.com/f/\w{12}' + __config__ = [("activated" , "bool" , "Activated" , True ), + ("use_premium" , "bool" , "Use premium account if available" , True ), + ("folder_per_package", "Default;Yes;No", "Create folder for each package" , "Default"), + ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )] + + + __description__ = """datafile.com decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")] + + LINK_PATTERN = r'https?://(?:www\.)?datafile\.com/d/\w{17}' + NAME_PATTERN = r'
(?P.+?)<' + + + def decrypt(self, pyfile): + self.data = self.load(pyfile.url) + + links = re.findall(self.LINK_PATTERN, self.data) + + m = re.search(self.NAME_PATTERN, self.data) + if m: + name = m.group('N') + self.packages.append((name, links, name)) + + else: + self.links.extend(links) \ No newline at end of file -- cgit v1.2.3