From 6c653c5eb10a4b77f2e63ad1e745ba612a46ae03 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sun, 8 Jan 2012 10:48:53 +0100 Subject: add premium4.me --- module/plugins/hoster/Premium4Me.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 module/plugins/hoster/Premium4Me.py (limited to 'module/plugins/hoster/Premium4Me.py') diff --git a/module/plugins/hoster/Premium4Me.py b/module/plugins/hoster/Premium4Me.py new file mode 100644 index 000000000..1d97e21b1 --- /dev/null +++ b/module/plugins/hoster/Premium4Me.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from urllib import quote +from module.plugins.Hoster import Hoster + +class Premium4Me(Hoster): + __name__ = "Premium4Me" + __version__ = "0.01" + __type__ = "hoster" + + __pattern__ = r"http://premium4.me/.*" + __description__ = """premium4.me hoster plugin""" + __author_name__ = ("RaNaN", "zoidberg") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") + + def setup(self): + self.chunkLimit = 3 + self.resumeDownload = True + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your premium4.me account or deactivate this plugin")) + self.fail("No premium4.me account provided") + + self.log.debug("premium4.me: Old URL: %s" % pyfile.url) + new_url = "http://premium4.me/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")) + + #raise timeout to 2min + self.req.setOption("timeout", 120) + + self.download(new_url, disposition=True) \ No newline at end of file -- cgit v1.2.3