def play_ch(params):
	http = GET('http://torrent-tv.ru/'+params['file'])
	print 'http://torrent-tv.ru/'+params['file']
	beautifulSoup = BeautifulSoup(http)
	tget= beautifulSoup.find('div', attrs={'class':'tv-player-wrapper'})
	#print tget
	#this.loadTorrent("http://94.242.221.195:7773/file?name=%D0%A2%D0%9D%D0%A2"
	#print http
	#print 'http://torrent-tv.ru/'+params['file']
	m=re.search('http:(.+)"', str(tget))
	torr_link= m.group(0).split('"')[0]
	m=re.search('http://[0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+', torr_link)
	try:
		pre_link= m.group(0)
		http = GET(pre_link)
		beautifulSoup = BeautifulSoup(http)
		lnk=pre_link+beautifulSoup.find('a')['href']
		#print lnk
		torr_link=lnk
	except: pass
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT',port=aceport)
	if out=='Ok':
		TSplayer.play_url_ind(0,params['title'],addon_icon,params['img'])
	TSplayer.end()
	showMessage('Торрент', 'Стоп', 2000)    
def stream (params):
	torr_link='f4a94963c11a47f213b145697f494b5fc5485b02'
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'INFOHASH',port=aceport)
	if out=='Ok':
		TSplayer.play_url_ind(0,'stream',None)
	TSplayer.end()
def play_ch_db(params):
    xbmc.executebuiltin('Action(Stop)')
    url = ''
    if params['file'] == '':
        db = DataBase(db_name, cookie='')
        url = db.GetUrlsStream(params['id'])
        if url.__len__() == 0:
            showMessage('Ошибка получения ссылки')
            return
    else:
        url = params['file']
    if url != '':
        TSPlayer = tsengine()
        out = None
        if url.find('http://') == -1:
            out = TSPlayer.load_torrent(url,'PID',port=aceport)
        else:
            out = TSPlayer.load_torrent(url,'TORRENT',port=aceport)
        if out == 'Ok':
            TSPlayer.play_url_ind(0,params['title'],addon_icon,params['img'])
            db = DataBase(db_name, cookie='')
            db.IncChannel(params['id'])
            del db
            TSPlayer.end()
            xbmc.executebuiltin('Container.Refresh')
            #showMessage('Torrent', 'Stop')
            return
Exemple #4
0
def play_ch_db(params):
    xbmc.executebuiltin('Action(Stop)')
    url = ''
    if params['file'] == '':
        db = DataBase(db_name, cookie='')
        url = db.GetUrlsStream(params['id'])
        if url.__len__() == 0:
            showMessage('Ошибка получения ссылки')
            return
    else:
        url = params['file']
    if url != '':
        TSPlayer = tsengine()
        out = None
        if url.find('http://') == -1:
            out = TSPlayer.load_torrent(url, 'PID', port=aceport)
        else:
            out = TSPlayer.load_torrent(url, 'TORRENT', port=aceport)
        if out == 'Ok':
            TSPlayer.play_url_ind(0, params['title'], addon_icon,
                                  params['img'])
            db = DataBase(db_name, cookie='')
            db.IncChannel(params['id'])
            del db
            TSPlayer.end()
            xbmc.executebuiltin('Container.Refresh')
            #showMessage('Torrent', 'Stop')
            return
Exemple #5
0
def play_ch(params):
    http = GET('http://torrent-tv.ru/' + params['file'])
    print 'http://torrent-tv.ru/' + params['file']
    beautifulSoup = BeautifulSoup(http)
    tget = beautifulSoup.find('div', attrs={'class': 'tv-player-wrapper'})
    #print tget
    #this.loadTorrent("http://94.242.221.195:7773/file?name=%D0%A2%D0%9D%D0%A2"
    #print http
    #print 'http://torrent-tv.ru/'+params['file']
    m = re.search('http:(.+)"', str(tget))
    torr_link = m.group(0).split('"')[0]
    m = re.search('http://[0-9]+.[0-9]+.[0-9]+.[0-9]+:[0-9]+', torr_link)
    try:
        pre_link = m.group(0)
        http = GET(pre_link)
        beautifulSoup = BeautifulSoup(http)
        lnk = pre_link + beautifulSoup.find('a')['href']
        #print lnk
        torr_link = lnk
    except:
        pass
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT', port=aceport)
    if out == 'Ok':
        TSplayer.play_url_ind(0, params['title'], addon_icon, params['img'])
    TSplayer.end()
    showMessage('Торрент', 'Стоп', 2000)
Exemple #6
0
def stream(params):
    torr_link = 'f4a94963c11a47f213b145697f494b5fc5485b02'
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'INFOHASH', port=aceport)
    if out == 'Ok':
        TSplayer.play_url_ind(0, 'stream', None)
    TSplayer.end()
def play_url2(params):
	torr_link=params['torr_url']	
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT',port=aceport)
	if out=='Ok':
		TSplayer.play_url_ind(int(params['ind']),params['title'],addon_icon,params['img'])
	TSplayer.end()
	showMessage('Торрент', 'Стоп', 2000)    
Exemple #8
0
def play_it(params):
	torr_link=params['torr_url']	
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'RAW',port=aceport)
	if out=='Ok':
		TSplayer.play_url_ind(int(params['ind']),params['title'],addon_icon,params['img'])
	TSplayer.end()
	showMessage('Торрент', 'Стоп', 2000, os.path.join(img_path, 'icon_torrentkg.png'))    
Exemple #9
0
def play_url2(params):
    torr_link = params['torr_url']
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT', port=aceport)
    if out == 'Ok':
        TSplayer.play_url_ind(int(params['ind']), params['title'], addon_icon,
                              params['img'])
    TSplayer.end()
    showMessage('Торрент', 'Стоп', 2000)
Exemple #10
0
def play_ace(torr_link, ind):
	from TSCore import TSengine as tsengine
	aceport=62062
	img=""
	title="title"
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT',port=aceport)
	if out=='Ok':
		TSplayer.play_url_ind(int(ind),title, icon, img)
	TSplayer.end()
Exemple #11
0
def play_ace(torr_link, ind):
    from TSCore import TSengine as tsengine
    aceport = 62062
    img = ""
    title = "title"
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT', port=aceport)
    if out == 'Ok':
        TSplayer.play_url_ind(int(ind), title, icon, img)
    TSplayer.end()
Exemple #12
0
def play_url2(params):
    #torr_link=params['torr_url']
    torr_link = urllib.unquote_plus(params["torr_url"])
    img = urllib.unquote_plus(params["img"])
    title = urllib.unquote_plus(params["title"])
    #showMessage('heading', torr_link, 10000)
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT', port=aceport)
    if out == 'Ok':
        TSplayer.play_url_ind(int(params['ind']), title, icon, img)
    TSplayer.end()
Exemple #13
0
def play_url2(params):
	#torr_link=params['torr_url']
	torr_link=urllib.unquote_plus(params["torr_url"])
	img=urllib.unquote_plus(params["img"])
	title=urllib.unquote_plus(params["title"])
	#showMessage('heading', torr_link, 10000)
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT',port=aceport)
	if out=='Ok':
		TSplayer.play_url_ind(int(params['ind']),title, icon, img)
	TSplayer.end()
Exemple #14
0
def play_url(params):
    torr_link = params['file']
    img = urllib.unquote_plus(params["img"])
    Engine = __settings__.getSetting("Engine")
    if Engine == "1":
        DownloadDirectory = __settings__.getSetting("DownloadDirectory")
        if DownloadDirectory == "": DownloadDirectory = LstDir
        playTorrent(torr_link, DownloadDirectory)
        return

    #showMessage('heading', torr_link, 10000)
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT')

    if out == 'Ok':
        j = 0
        for k, v in TSplayer.files.iteritems():
            j += 1
            li = xbmcgui.ListItem(urllib.unquote(k))
            uri = construct_request({
                'torr_url': torr_link,
                'title': k,
                'ind': v,
                'img': img,
                'mode': 'play_url2'
            })
            try:
                if k in eval(__settings__.getSetting("History")):
                    li.select(True)
            except:
                pass
            li.addContextMenuItems([(
                'Hайти на KrasFS',
                'XBMC.ActivateWindow(10025,"plugin://plugin.video.LostFilm/?mode=KFS&text='
                + k + '")',
                'XBMC.ActivateWindow(10025,"plugin://plugin.video.LostFilm/?mode=OpenCat&text=0&file='
                + url + '&img=' + img + '")')])
            #crt=construct_request({'mode': 'KFS','text': k})
            #li.addContextMenuItems([('Hайти на KrasFS', 'XBMC.RunPlugin("plugin://plugin.video.LostFilm/?mode=KFS&text='+k+'")')])
            xbmcplugin.addDirectoryItem(handle, uri, li, False)

    if j < 2:
        #play_url2({'torr_url': torr_link,'title': k,'ind':v,'img':img,'mode': 'play_url2'})
        TSplayer.play_url_ind(1, k, icon, img)
        TSplayer.end()
        return j

    xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.endOfDirectory(handle)
    TSplayer.end()
Exemple #15
0
def play_ch(params):
	http = GET_HTML({'url':'http://torrent-tv.ru/'+params['file']})
	beautifulSoup = BeautifulSoup(http)
	tget= beautifulSoup.find('div', attrs={'class':'tv-player-wrapper'})
	#print tget
	#this.loadTorrent("http://94.242.221.195:7773/file?name=%D0%A2%D0%9D%D0%A2"
	#print http
	#print 'http://torrent-tv.ru/'+params['file']
	m=re.search('http:(.+)"', str(tget))
	torr_link= m.group(0).split('"')[0]
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT',port=aceport)
	if out=='Ok':
		TSplayer.play_url_ind(0,params['title'],addon_icon,params['img'])
	TSplayer.end()
	showMessage('Торрент', 'Стоп', 2000, os.path.join(img_path, 'icon_torrenttvru.png'))
Exemple #16
0
def play_url2(params):
	#torr_link=params['torr_url']
	torr_link=urllib.unquote_plus(params["torr_url"])
	img=urllib.unquote_plus(params["img"])
	title=urllib.unquote_plus(params["title"])
	H=__settings__.getSetting("History")
	if H=='': HL=[]
	else: HL=eval(H)
	if title not in HL: 
		HL.append(title)
		__settings__.setSetting("History", repr(HL))
	#showMessage('heading', torr_link, 10000)
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT')
	if out=='Ok':
		TSplayer.play_url_ind(int(params['ind']),title, icon, img)
	TSplayer.end()
Exemple #17
0
def play_url2(params):
    #torr_link=params['torr_url']
    torr_link = urllib.unquote_plus(params["torr_url"])
    img = urllib.unquote_plus(params["img"])
    title = urllib.unquote_plus(params["title"])
    H = __settings__.getSetting("History")
    if H == '': HL = []
    else: HL = eval(H)
    if title not in HL:
        HL.append(title)
        __settings__.setSetting("History", repr(HL))
    #showMessage('heading', torr_link, 10000)
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT')
    if out == 'Ok':
        TSplayer.play_url_ind(int(params['ind']), title, icon, img)
    TSplayer.end()
Exemple #18
0
def torrentkg_play(params):
	torr_link = base64.b64encode(GET_HTML({'url':params['url'], 'cookie':params['cookie']}))
	xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
	TSplayer = tsengine()
	out      = TSplayer.load_torrent(torr_link, 'RAW', port=aceport)
	if out == 'Ok':
		for k,v in TSplayer.files.iteritems():
			li  = xbmcgui.ListItem(urllib.unquote(k))
			uri = construct_request({
				'torr_url' : torr_link,
				'title'    : k,
				'ind'      : v,
				'img'      : None,
				'func'     : 'play_it'
			})
			xbmcplugin.addDirectoryItem(hos, uri, li, False)
	xbmcplugin.endOfDirectory(hos)
	TSplayer.end()
Exemple #19
0
def play_url(params):
    torr_link = params['file']

    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT', port=aceport)
    if out == 'Ok':
        for k, v in TSplayer.files.iteritems():
            li = xbmcgui.ListItem(urllib.unquote(k))
            uri = construct_request({
                'torr_url': torr_link,
                'title': k,
                'ind': v,
                'img': None,
                'func': 'play_url2'
            })
            xbmcplugin.addDirectoryItem(hos, uri, li, False)
    xbmcplugin.endOfDirectory(hos)
    TSplayer.end()
def play_url(params):
	torr_link=params['file']
	
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT',port=aceport)
	if out=='Ok':
		for k,v in TSplayer.files.iteritems():
			li = xbmcgui.ListItem(urllib.unquote(k))
			uri = construct_request({
				'torr_url': torr_link,
				'title': k,
				'ind':v,
				'img':None,
				'func': 'play_url2'
			})
			xbmcplugin.addDirectoryItem(hos, uri, li, False)
	xbmcplugin.endOfDirectory(hos)
	TSplayer.end()
Exemple #21
0
def play_url(params):
	torr_link=params['file']
	img=urllib.unquote_plus(params["img"])
	Engine = __settings__.getSetting("Engine")
	if Engine=="1":
		DownloadDirectory = __settings__.getSetting("DownloadDirectory")
		if DownloadDirectory=="":DownloadDirectory=LstDir
		playTorrent(torr_link, DownloadDirectory)
		return

	#showMessage('heading', torr_link, 10000)
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT')
	
	if out=='Ok':
		j=0
		for k,v in TSplayer.files.iteritems():
			j+=1
			li = xbmcgui.ListItem(urllib.unquote(k))
			uri = construct_request({
				'torr_url': torr_link,
				'title': k,
				'ind':v,
				'img':img,
				'mode': 'play_url2'
			})
			try:
				if k in eval(__settings__.getSetting("History")): li.select(True)
			except:
				pass
			li.addContextMenuItems([('Hайти на KrasFS', 'XBMC.ActivateWindow(10025,"plugin://plugin.video.LostFilm/?mode=KFS&text='+k+'")', 'XBMC.ActivateWindow(10025,"plugin://plugin.video.LostFilm/?mode=OpenCat&text=0&file='+url+'&img='+img+'")')])
			#crt=construct_request({'mode': 'KFS','text': k})
			#li.addContextMenuItems([('Hайти на KrasFS', 'XBMC.RunPlugin("plugin://plugin.video.LostFilm/?mode=KFS&text='+k+'")')])
			xbmcplugin.addDirectoryItem(handle, uri, li, False)

	if j<2:
		#play_url2({'torr_url': torr_link,'title': k,'ind':v,'img':img,'mode': 'play_url2'})
		TSplayer.play_url_ind(1,k, icon, img)
		TSplayer.end()
		return j

	xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_LABEL)
	xbmcplugin.endOfDirectory(handle)
	TSplayer.end()
Exemple #22
0
def play_url_old(params):
    torr_link = params['file']
    img = urllib.unquote_plus(params["img"])
    #showMessage('heading', torr_link, 10000)
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'TORRENT')
    if out == 'Ok':
        for k, v in TSplayer.files.iteritems():
            li = xbmcgui.ListItem(urllib.unquote(k))
            uri = construct_request({
                'torr_url': torr_link,
                'title': k,
                'ind': v,
                'img': img,
                'mode': 'play_url2'
            })
            xbmcplugin.addDirectoryItem(handle, uri, li, False)
    xbmcplugin.endOfDirectory(handle)
    TSplayer.end()
Exemple #23
0
def play_url_old(params):
	torr_link=params['file']
	img=urllib.unquote_plus(params["img"])
	#showMessage('heading', torr_link, 10000)
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'TORRENT')
	if out=='Ok':
		for k,v in TSplayer.files.iteritems():
			li = xbmcgui.ListItem(urllib.unquote(k))
			uri = construct_request({
				'torr_url': torr_link,
				'title': k,
				'ind':v,
				'img':img,
				'mode': 'play_url2'
			})
			xbmcplugin.addDirectoryItem(handle, uri, li, False)
	xbmcplugin.endOfDirectory(handle)
	TSplayer.end()
Exemple #24
0
def play_file(params):
    #получаем содержимое файла в base64
    f = open(params['file'].decode('utf-8'), 'rb')
    buf = f.read()
    f.close
    torr_link = base64.b64encode(buf)
    xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
    TSplayer = tsengine()
    out = TSplayer.load_torrent(torr_link, 'RAW', port=aceport)
    if out == 'Ok':
        for k, v in TSplayer.files.iteritems():

            li = xbmcgui.ListItem(urllib.unquote(k))
            uri = construct_request({
                'torr_url': torr_link,
                'title': k,
                'ind': v,
                'img': None,
                'func': 'play_it'
            })
            xbmcplugin.addDirectoryItem(hos, uri, li, False)
    xbmcplugin.endOfDirectory(hos)
    TSplayer.end()
def play_file(params):
	#получаем содержимое файла в base64
	f = open(params['file'].decode('utf-8'), 'rb')
	buf=f.read()
	f.close
	torr_link=base64.b64encode(buf)
	xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,'RAW',port=aceport)
	if out=='Ok':
		for k,v in TSplayer.files.iteritems():

			li = xbmcgui.ListItem(urllib.unquote(k))
			uri = construct_request({
				'torr_url': torr_link,
				'title': k,
				'ind':v,
				'img':None,
				'func': 'play_it'
			})
			xbmcplugin.addDirectoryItem(hos, uri, li, False)
	xbmcplugin.endOfDirectory(hos)
	TSplayer.end()
Exemple #26
0
def play_url(params):
	Engine = __settings__.getSetting("Engine")
	if Engine=="1":
		torr_link=params['file']
		DownloadDirectory = __settings__.getSetting("DownloadDirectory")
		if DownloadDirectory=="":DownloadDirectory=LstDir
		openTorrent(torr_link, DownloadDirectory)
		return False

	img=urllib.unquote_plus(params["img"])
	if __settings__.getSetting("immunicity") == "2":
		import base64
		file=GETtorr(params['file'])
		f = open(file.decode('utf-8'), 'rb')
		buf=f.read()
		f.close
		torr_link=base64.b64encode(buf)
		tmd='RAW'
	else:
		torr_link=params['file']
		tmd='TORRENT'
	
	if Engine=="2":
		purl ="plugin://plugin.video.yatp/?action=play&torrent="+ urllib.quote_plus(torr_link)
		xbmc.executebuiltin("PlayMedia("+purl+")")
		return False
	
	if Engine=="3":
		tthp.play(torr_link, handle, 0, __settings__.getSetting("DownloadDirectory"))
		return False
	
	#showMessage('heading', torr_link, 10000)
	TSplayer=tsengine()
	out=TSplayer.load_torrent(torr_link,tmd)#'TORRENT'
	
	if out=='Ok':
		j=0
		for k,v in TSplayer.files.iteritems():
			j+=1
			li = xbmcgui.ListItem(urllib.unquote(k))
			uri = construct_request({
				'torr_url': torr_link,
				'title': k,
				'ind':v,
				'img':img,
				'mode': 'play_url2'
			})
			try:
				if k in eval(__settings__.getSetting("History")): li.select(True)
			except:
				pass
			#li.addContextMenuItems([('Hайти на KrasFS', 'XBMC.ActivateWindow(10025,"plugin://plugin.video.LostFilm/?mode=KFS&text='+k+'")', 'XBMC.ActivateWindow(10025,"plugin://plugin.video.LostFilm/?mode=OpenCat&text=0&file='+url+'&img='+img+'")')])
			xbmcplugin.addDirectoryItem(handle, uri, li, False)

		if j<2:
			xbmcplugin.endOfDirectory(handle, False, False)
			#play_url2({'torr_url': torr_link,'title': k,'ind':v,'img':img,'mode': 'play_url2'})
			TSplayer.play_url_ind(0,k, icon, img)
			TSplayer.end()
			return j

	xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_LABEL)
	xbmcplugin.endOfDirectory(handle)
	TSplayer.end()