diff options
author | 2014-12-13 15:56:57 +0100 | |
---|---|---|
committer | 2014-12-13 15:56:57 +0100 | |
commit | acc46fc3497a66a427b795b4a22c6e71d69185a1 (patch) | |
tree | 2d315b838a76435fc456b972c99c28d1732b2f70 /pyload/plugin/hoster/RehostTo.py | |
parent | Code fixes (diff) | |
download | pyload-acc46fc3497a66a427b795b4a22c6e71d69185a1.tar.xz |
Update
Diffstat (limited to 'pyload/plugin/hoster/RehostTo.py')
-rw-r--r-- | pyload/plugin/hoster/RehostTo.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pyload/plugin/hoster/RehostTo.py b/pyload/plugin/hoster/RehostTo.py new file mode 100644 index 000000000..75fae2449 --- /dev/null +++ b/pyload/plugin/hoster/RehostTo.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +from urllib import quote, unquote + +from pyload.plugin.Hoster import Hoster + + +class RehostTo(Hoster): + __name = "RehostTo" + __type = "hoster" + __version = "0.13" + + __pattern = r'https?://.*rehost\.to\..*' + + __description = """Rehost.com hoster plugin""" + __license = "GPLv3" + __authors = [("RaNaN", "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) + + #raise timeout to 2min + self.req.setOption("timeout", 120) + + self.download("http://rehost.to/process_download.php", + get={'user': "cookie", 'pass': long_ses, 'dl': quote(pyfile.url, "")}, + disposition=True) |