summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/UploadedToFolder.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-04-06 21:50:25 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-04-06 21:50:25 +0200
commitd2cd60cc6dbaa7aceb1d1cd3019aa7089ddfdcd9 (patch)
treebd2a477e9c5338a15d71ac89ea9f364d8eacec5a /module/plugins/crypter/UploadedToFolder.py
parentNetfolderIn, SimpleCrypter: stripping folder name. (diff)
downloadpyload-d2cd60cc6dbaa7aceb1d1cd3019aa7089ddfdcd9.tar.xz
Using SimpleCrypter to avoid repeating getPackageNameAndFolder.
+ licenses + cosmetics
Diffstat (limited to 'module/plugins/crypter/UploadedToFolder.py')
-rw-r--r--module/plugins/crypter/UploadedToFolder.py35
1 files changed, 20 insertions, 15 deletions
diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py
index d4534297e..7fe4de688 100644
--- a/module/plugins/crypter/UploadedToFolder.py
+++ b/module/plugins/crypter/UploadedToFolder.py
@@ -1,13 +1,30 @@
# -*- coding: utf-8 -*-
-from module.plugins.Crypter import Crypter
+############################################################################
+# 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 <http://www.gnu.org/licenses/>. #
+############################################################################
+
import re
-class UploadedToFolder(Crypter):
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
+
+
+class UploadedToFolder(SimpleCrypter):
__name__ = "UploadedToFolder"
__type__ = "crypter"
__pattern__ = r"http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|list)/(?P<id>\w+)"
- __version__ = "0.1"
+ __version__ = "0.2"
__description__ = """UploadedTo Crypter Plugin"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
@@ -31,15 +48,3 @@ class UploadedToFolder(Crypter):
self.logDebug('Package has %d links' % len(package_links))
self.packages = [(package_name, package_links, folder_name)]
-
- def getPackageNameAndFolder(self):
- m = re.search(self.TITLE_PATTERN, self.html)
- if m:
- name = folder = m.group('title')
- self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
- return name, folder
- else:
- name = self.pyfile.package().name
- folder = self.pyfile.package().folder
- self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
- return name, folder