summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/RehostTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/RehostTo.py')
-rw-r--r--module/plugins/hoster/RehostTo.py43
1 files changed, 17 insertions, 26 deletions
diff --git a/module/plugins/hoster/RehostTo.py b/module/plugins/hoster/RehostTo.py
index 79c06f863..28de35d08 100644
--- a/module/plugins/hoster/RehostTo.py
+++ b/module/plugins/hoster/RehostTo.py
@@ -1,37 +1,28 @@
# -*- coding: utf-8 -*-
-from urllib import quote, unquote
-from module.plugins.Hoster import Hoster
+from urllib import unquote
+from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
-class RehostTo(Hoster):
- __name__ = "RehostTo"
- __version__ = "0.13"
- __type__ = "hoster"
- __pattern__ = r'https?://.*rehost.to\..*'
- __description__ = """Rehost.com hoster plugin"""
- __author_name__ = "RaNaN"
- __author_mail__ = "RaNaN@pyload.org"
- def getFilename(self, url):
- return unquote(url.rsplit("/", 1)[1])
+class RehostTo(MultiHoster):
+ __name__ = "RehostTo"
+ __type__ = "hoster"
+ __version__ = "0.21"
- def setup(self):
- self.chunkLimit = 1
- self.resumeDownload = True
+ __pattern__ = r'https?://.*rehost\.to\..+'
- def process(self, pyfile):
- if not self.account:
- self.logError(_("Please enter your %s account or deactivate this plugin") % "rehost.to")
- self.fail("No rehost.to account provided")
+ __description__ = """Rehost.com multi-hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("RaNaN", "RaNaN@pyload.org")]
- data = self.account.getAccountInfo(self.user)
- long_ses = data['long_ses']
- self.logDebug("Rehost.to: Old URL: %s" % pyfile.url)
- new_url = "http://rehost.to/process_download.php?user=cookie&pass=%s&dl=%s" % (long_ses, quote(pyfile.url, ""))
+ def handlePremium(self, pyfile):
+ self.download("http://rehost.to/process_download.php",
+ get={'user': "cookie",
+ 'pass': self.account.getAccountInfo(self.user)['session'],
+ 'dl' : pyfile.url},
+ disposition=True)
- #raise timeout to 2min
- self.req.setOption("timeout", 120)
- self.download(new_url, disposition=True)
+getInfo = create_getInfo(RehostTo)