summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/TurbobitNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/TurbobitNet.py')
-rw-r--r--module/plugins/hoster/TurbobitNet.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py
index f4eaa90cc..7995bd0c0 100644
--- a/module/plugins/hoster/TurbobitNet.py
+++ b/module/plugins/hoster/TurbobitNet.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
+import binascii
+import pycurl
import random
import re
import time
+import urllib
from Crypto.Cipher import ARC4
-from binascii import hexlify, unhexlify
-from pycurl import HTTPHEADER
-from urllib import quote
from module.network.RequestFactory import getURL
from module.plugins.internal.CaptchaService import ReCaptcha
@@ -50,11 +50,11 @@ class TurbobitNet(SimpleHoster):
self.solveCaptcha()
- self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
+ self.req.http.c.setopt(pycurl.HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
self.html = self.load(self.getDownloadUrl(rtUpdate))
- self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With:"])
+ self.req.http.c.setopt(pycurl.HTTPHEADER, ["X-Requested-With:"])
m = re.search(self.LINK_FREE_PATTERN, self.html)
if m:
@@ -134,7 +134,7 @@ class TurbobitNet(SimpleHoster):
for b in [1, 3]:
self.jscode = "var id = \'%s\';var b = %d;var inn = \'%s\';%sout" % (
- self.info['pattern']['ID'], b, quote(fun), rtUpdate)
+ self.info['pattern']['ID'], b, urllib.quote(fun), rtUpdate)
try:
out = self.js.eval(self.jscode)
@@ -155,8 +155,8 @@ class TurbobitNet(SimpleHoster):
def decrypt(self, data):
- cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0'))
- return unhexlify(cipher.encrypt(unhexlify(data)))
+ cipher = ARC4.new(binascii.hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0'))
+ return binascii.unhexlify(cipher.encrypt(binascii.unhexlify(data)))
def getLocalTimeString(self):