summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/RehostTo.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-08 00:29:57 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 11:02:23 +0200
commit68d662e689cd42687341c550fb6ebb74e6968d21 (patch)
tree486cef41bd928b8db704894233b2cef94a6e346f /pyload/plugins/hoster/RehostTo.py
parentsave_join -> safe_join & save_path -> safe_filename (diff)
downloadpyload-68d662e689cd42687341c550fb6ebb74e6968d21.tar.xz
module -> pyload
Diffstat (limited to 'pyload/plugins/hoster/RehostTo.py')
-rw-r--r--pyload/plugins/hoster/RehostTo.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/pyload/plugins/hoster/RehostTo.py b/pyload/plugins/hoster/RehostTo.py
new file mode 100644
index 000000000..d3d3fcd8b
--- /dev/null
+++ b/pyload/plugins/hoster/RehostTo.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+
+from urllib import quote, unquote
+
+from pyload.plugins.Hoster import Hoster
+
+
+class RehostTo(Hoster):
+ __name__ = "RehostTo"
+ __type__ = "hoster"
+ __version__ = "0.13"
+
+ __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])
+
+ def setup(self):
+ self.chunkLimit = 1
+ self.resumeDownload = True
+
+ 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")
+
+ 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, ""))
+
+ #raise timeout to 2min
+ self.req.setOption("timeout", 120)
+
+ self.download(new_url, disposition=True)