From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/hooks/ExpertDecoders.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks/ExpertDecoders.py') diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 13289f8d1..af5f2cfcd 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -8,7 +8,7 @@ import uuid from base64 import b64encode from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL, getRequest +from module.network.RequestFactory import getRequest from module.plugins.internal.Hook import Hook, threaded @@ -36,7 +36,7 @@ class ExpertDecoders(Hook): def getCredits(self): - res = getURL(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"}) + res = self.load(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"}) if res.isdigit(): self.logInfo(_("%s credits left") % res) @@ -60,11 +60,12 @@ class ExpertDecoders(Hook): req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: - result = req.load(self.API_URL, - post={'action' : "upload", + result = self.load(self.API_URL, + post={'action' : "upload", 'key' : self.getConfig('passkey'), 'file' : b64encode(data), - 'gen_task_id': ticket}) + 'gen_task_id': ticket}, + req=req) finally: req.close() @@ -95,7 +96,7 @@ class ExpertDecoders(Hook): if "ticket" in task.data: try: - res = getURL(self.API_URL, + res = self.load(self.API_URL, post={'action': "refund", 'key': self.getConfig('passkey'), 'gen_task_id': task.data['ticket']}) self.logInfo(_("Request refund"), res) -- cgit v1.2.3