summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Tim Gregory <bogeyman@valar.de> 2016-04-11 22:13:41 +0200
committerGravatar Tim Gregory <bogeyman@valar.de> 2016-04-12 14:14:40 +0200
commitaee402317122281e7e361beb1b0eb0f5f6ed126d (patch)
treec5deec501bfca089a22897cf1c4ade1f4a342e8d /module
parent[MultiHome] version up (diff)
downloadpyload-aee402317122281e7e361beb1b0eb0f5f6ed126d.tar.xz
Support onlinetvrecorder.com
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/OnlineTvRecorder.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/module/plugins/hoster/OnlineTvRecorder.py b/module/plugins/hoster/OnlineTvRecorder.py
new file mode 100644
index 000000000..7eeaceb70
--- /dev/null
+++ b/module/plugins/hoster/OnlineTvRecorder.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.hoster.Http import Http
+from module.network.HTTPRequest import BadHeader
+
+# Support onlinetvrecorder.com
+
+class OnlineTvRecorder(Http):
+ __name__ = "OnlineTvRecorder"
+ __type__ = "hoster"
+ __version__ = "0.01"
+ __status__ = "testing"
+
+ # RIPE Database:
+ # inetnum: 81.95.11.0 - 81.95.11.63
+ # route: 81.95.8.0/21
+ __pattern__ = r'http://81\.95\.11\.\d{1,2}/download/\d+/\d+/\d*/[0-9a-f]+/.+'
+ __config__ = [("activated", "bool", "Activated", True)]
+ __description__ = """OnlineTvRecorder hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("Tim Gregory", "bogeyman@valar.de")]
+
+ def setup(self):
+ # OnlineTvRecorder policy
+ self.multiDL = False
+ self.chunk_limit = 1
+ self.resume_download = True
+
+ def process(self, pyfile):
+ try:
+ return super(OnlineTvRecorder, self).process(pyfile)
+
+ except BadHeader, e:
+ self.log_debug("OnlineTvRecorder httpcode: %d" % e.code)
+ if e.code == 503:
+ # max queueing for 3 hours
+ self.retry(360, 30, _("Waiting in download queue"))