summaryrefslogtreecommitdiffstats
path: root/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins')
-rw-r--r--Plugins/Plugin.py3
-rw-r--r--Plugins/RapidshareCom.py7
-rw-r--r--Plugins/UploadedTo.py3
3 files changed, 8 insertions, 5 deletions
diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py
index 44ba119e1..971677ec7 100644
--- a/Plugins/Plugin.py
+++ b/Plugins/Plugin.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
from time import time
-
+from module.network.Request import Request
class Plugin():
@@ -19,6 +19,7 @@ class Plugin():
pluginProp ['author_email'] = "nn@nn.de"
self.pluginProp = pluginProp
self.parent = parent
+ self.req = Request()
self.html = None
self.time_plus_wait = None #time() + wait in seconds
self.want_reconnect = None
diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py
index 6f81a9549..8adf89e25 100644
--- a/Plugins/RapidshareCom.py
+++ b/Plugins/RapidshareCom.py
@@ -12,6 +12,7 @@ from time import time
class RapidshareCom(Plugin):
def __init__(self, parent):
+ Plugin.__init__(self, parent)
self.plugin_name = "Rapidshare.com"
self.plugin_pattern = r"http://(?:www.)?rapidshare.com/files/"
self.plugin_type = "hoster"
@@ -46,7 +47,7 @@ class RapidshareCom(Plugin):
""" gets the url from self.parent.url saves html in self.html and parses
"""
url = self.parent.url
- html = urllib2.urlopen(url).read()
+ html = self.req.load(url)
self.html[0] = html
self.html_old = time()
@@ -58,8 +59,8 @@ class RapidshareCom(Plugin):
file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1)
#free user
- free_user_encode = urllib.urlencode({"dl.start" : "Free"})
- self.html[1] = urllib2.urlopen(file_server_url, free_user_encode).read()
+ #free_user_encode = urllib.urlencode({"dl.start" : "Free"})
+ self.html[1] = self.req.load(file_server_url, None,{"dl.start" : "Free"})
self.html_old = time()
self.get_wait_time()
diff --git a/Plugins/UploadedTo.py b/Plugins/UploadedTo.py
index fe2c3ec37..0d00c8aa6 100644
--- a/Plugins/UploadedTo.py
+++ b/Plugins/UploadedTo.py
@@ -8,6 +8,7 @@ from Plugin import Plugin
class UploadedTo(Plugin):
def __init__(self, parent):
+ Plugin.__init__(self, parent)
self.plugin_name = "Uploaded.to"
self.plugin_pattern = r"http://(www\.)?uploaded.to/"
self.plugin_type = "hoster"
@@ -37,7 +38,7 @@ class UploadedTo(Plugin):
def download_html(self):
url = self.parent.url
- self.html = urllib2.urlopen(url).read()
+ self.html = req.load(url)
try:
wait_minutes = re.search(r"Or wait (\d+) minutes", self.html).group(1)