summaryrefslogtreecommitdiffstats
path: root/module/plugins/internal/XFSHoster.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-01 01:06:01 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-01 01:06:01 +0200
commit1ef93e913238275f7657d496ba3d2e7eeb5a30a2 (patch)
treec52a2ab51763fce4a9b47d3c62388a27ebdeeda8 /module/plugins/internal/XFSHoster.py
parentFix https://github.com/pyload/pyload/issues/1373 (diff)
downloadpyload-1ef93e913238275f7657d496ba3d2e7eeb5a30a2.tar.xz
Use 'import' instead 'from'
Diffstat (limited to 'module/plugins/internal/XFSHoster.py')
-rw-r--r--module/plugins/internal/XFSHoster.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py
index 027e68236..33dc6d16b 100644
--- a/module/plugins/internal/XFSHoster.py
+++ b/module/plugins/internal/XFSHoster.py
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
+import pycurl
+import random
import re
-import time
-
-from random import random
-from urlparse import urljoin, urlparse
-
-from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME
+import urlparse
from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, secondsToMidnight
@@ -101,11 +98,11 @@ class XFSHoster(SimpleHoster):
data = self.getPostParameters()
- self.req.http.c.setopt(FOLLOWLOCATION, 0)
+ self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0)
self.html = self.load(pyfile.url, post=data, decode=True)
- self.req.http.c.setopt(FOLLOWLOCATION, 1)
+ self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1)
m = re.search(r'Location\s*:\s*(.+)', self.req.http.header, re.I)
if m and not "op=" in m.group(1):
@@ -134,7 +131,7 @@ class XFSHoster(SimpleHoster):
action, inputs = self.parseHtmlForm()
- upload_id = "%012d" % int(random() * 10 ** 12)
+ upload_id = "%012d" % int(random.random() * 10 ** 12)
action += upload_id + "&js_on=1&utype=prem&upload_type=url"
inputs['tos'] = '1'