summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/StreamcloudEu.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/StreamcloudEu.py')
-rw-r--r--module/plugins/hoster/StreamcloudEu.py36
1 files changed, 20 insertions, 16 deletions
diff --git a/module/plugins/hoster/StreamcloudEu.py b/module/plugins/hoster/StreamcloudEu.py
index 388eb7876..11333640e 100644
--- a/module/plugins/hoster/StreamcloudEu.py
+++ b/module/plugins/hoster/StreamcloudEu.py
@@ -1,33 +1,37 @@
# -*- coding: utf-8 -*-
-from time import sleep
import re
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
+from time import sleep
+
from module.network.HTTPRequest import HTTPRequest
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
class StreamcloudEu(XFileSharingPro):
__name__ = "StreamcloudEu"
__type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+'
__version__ = "0.04"
+
+ __pattern__ = r'http://(?:www\.)?streamcloud\.eu/\S+'
+
__description__ = """Streamcloud.eu hoster plugin"""
__author_name__ = "seoester"
__author_mail__ = "seoester@googlemail.com"
HOSTER_NAME = "streamcloud.eu"
- DIRECT_LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",'
+ LINK_PATTERN = r'file: "(http://(stor|cdn)\d+\.streamcloud.eu:?\d*/.*/video\.(mp4|flv))",'
+
def setup(self):
super(StreamcloudEu, self).setup()
self.multiDL = True
def getDownloadLink(self):
- found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S)
- if found:
- return found.group(1)
+ m = re.search(self.LINK_PATTERN, self.html, re.S)
+ if m:
+ return m.group(1)
for i in xrange(5):
self.logDebug("Getting download link: #%d" % i)
@@ -38,12 +42,12 @@ class StreamcloudEu(XFileSharingPro):
self.html = httpRequest.load(self.pyfile.url, post=data, referer=False, cookies=True, decode=True)
self.header = httpRequest.header
- found = re.search("Location\s*:\s*(.*)", self.header, re.I)
- if found:
+ m = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ if m:
break
- found = re.search(self.DIRECT_LINK_PATTERN, self.html, re.S)
- if found:
+ m = re.search(self.LINK_PATTERN, self.html, re.S)
+ if m:
break
else:
@@ -52,7 +56,7 @@ class StreamcloudEu(XFileSharingPro):
else:
self.fail("Download link not found")
- return found.group(1)
+ return m.group(1)
def getPostParameters(self):
for i in xrange(3):
@@ -74,7 +78,7 @@ class StreamcloudEu(XFileSharingPro):
self.logDebug(self.HOSTER_NAME, inputs)
- if 'op' in inputs and inputs['op'] in ('download1', 'download2', 'download3'):
+ if 'op' in inputs and inputs['op'] in ("download1", "download2", "download3"):
if "password" in inputs:
if self.passwords:
inputs['password'] = self.passwords.pop(0)
@@ -82,9 +86,9 @@ class StreamcloudEu(XFileSharingPro):
self.fail("No or invalid passport")
if not self.premium:
- found = re.search(self.WAIT_PATTERN, self.html)
- if found:
- wait_time = int(found.group(1)) + 1
+ m = re.search(self.WAIT_PATTERN, self.html)
+ if m:
+ wait_time = int(m.group(1)) + 1
self.setWait(wait_time, False)
else:
wait_time = 0