Código: Seleccionar todo
if opciones[seleccion]==config.get_localized_string(30158): # "Enviar a JDownloader"
if server=="Megaupload":
d = "http://www.megaupload.com/?d=" + url
else:
d = "http://www.megavideo.com/?v=" + url
sys.path.append('/usr/lib/python2.7/site-packages')
from urlparse import urlparse
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.transport import THttpClient
from thrift.protocol import TBinaryProtocol
import Pyload
from ttypes import *
#from core import scrapertools
#data = scrapertools.cachePage(config.get_setting("jdownloader")+"/action/add/links/grabber0/start1/"+urllib.urlencode(d)+ " " +thumbnail)
host = '192.168.1.5'
port = 7230
uri = ''
socket = TSocket.TSocket(host, port)
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
client = Pyload.Client(protocol)
transport.open()
client.login("user","pass",)
client.addPackage("Prueba thrift", d,0)
return