From 3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 25 Aug 2010 16:48:55 +0200 Subject: merged gui --- core/module/plugins/hoster/BasePlugin.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 core/module/plugins/hoster/BasePlugin.py (limited to 'core/module/plugins/hoster/BasePlugin.py') diff --git a/core/module/plugins/hoster/BasePlugin.py b/core/module/plugins/hoster/BasePlugin.py new file mode 100644 index 000000000..09545d493 --- /dev/null +++ b/core/module/plugins/hoster/BasePlugin.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.plugins.Hoster import Hoster + +class BasePlugin(Hoster): + __name__ = "BasePlugin" + __type__ = "hoster" + __pattern__ = r"^unmatchable$" + __version__ = "0.1" + __description__ = """Base Plugin when any other didnt fit""" + __author_name__ = ("RaNaN") + __author_mail__ = ("RaNaN@pyload.org") + + def process(self, pyfile): + """main function""" + + if pyfile.url.startswith("http://"): + + pyfile.name = re.findall("([^\/=]+)", pyfile.url)[-1] + self.download(pyfile.url) + + else: + self.fail("No Plugin matched and not a downloadable url.") \ No newline at end of file -- cgit v1.2.3