From cd1926a9be479e18d7782075c0687fd4733a93c3 Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 22 Jun 2013 20:39:19 +0200 Subject: DdlstogrageComFolder: fixed regex. Now based on SimpleCrypter --- module/plugins/crypter/DdlstorageComFolder.py | 46 +++++++++++++-------------- 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'module/plugins/crypter/DdlstorageComFolder.py') diff --git a/module/plugins/crypter/DdlstorageComFolder.py b/module/plugins/crypter/DdlstorageComFolder.py index d536032c6..d76988c92 100644 --- a/module/plugins/crypter/DdlstorageComFolder.py +++ b/module/plugins/crypter/DdlstorageComFolder.py @@ -1,32 +1,30 @@ # -*- coding: utf-8 -*- -import re -from module.plugins.Crypter import Crypter -from module.plugins.hoster.MediafireCom import checkHTMLHeader -from module.common.json_layer import json_loads +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero 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 Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ -class DdlstorageComFolder(Crypter): +from module.plugins.internal.SimpleCrypter import SimpleCrypter + + +class DdlstorageComFolder(SimpleCrypter): __name__ = "DdlstorageComFolder" __type__ = "crypter" __pattern__ = r"http://(?:\w*\.)*?ddlstorage.com/folder/\w{10}" - __version__ = "0.01" + __version__ = "0.02" __description__ = """DDLStorage.com Folder Plugin""" - __author_name__ = ("godofdream") - __author_mail__ = ("soilfiction@gmail.com") - - FILE_URL_PATTERN = '' + __author_name__ = ("godofdream", "stickell") + __author_mail__ = ("soilfiction@gmail.com", "l.stickell@yahoo.it") - def decrypt(self, pyfile): - new_links = [] - # load and parse html - html = self.load(pyfile.url) - found = re.findall(self.FILE_URL_PATTERN, html) - self.logDebug(found) - for link in found: - # file page - new_links.append("http://www.ddlstorage.com/%s" % link) - - if new_links: - self.core.files.addLinks(new_links, self.pyfile.package().id) - else: - self.fail('Could not extract any links') + LINK_PATTERN = '' -- cgit v1.2.3