summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2016-04-17 03:52:32 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2016-04-17 03:52:32 +0200
commite7bf02e73fb5de88074cdc131b9e72367a054056 (patch)
tree0d0f714f25eee696082926cbd689758013d32736 /module
parent[RapidgatorNet] Fix #2423 (diff)
parentSupport onlinetvrecorder.com (diff)
downloadpyload-e7bf02e73fb5de88074cdc131b9e72367a054056.tar.xz
Merge pull request #2422 from bogeyman/stable
Support hoster 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"))