def showmenu0(self, cItem):
     multi_tab = xtream_get_conf()
     if len(multi_tab) == 0:
         self.addMarker({
             'title':
             'Please configure xstream first',
             'icon':
             cItem['icon'],
             'desc':
             'Please configure xstream first, (add user,pass &host in tsiplayer params or add your config file in /etc/tsiplayer_xtream.conf)'
         })
     elif len(multi_tab) == 1:
         self.showmenu1({
             'import': cItem['import'],
             'icon': cItem['icon'],
             'xuser': multi_tab[0][2],
             'xpass': multi_tab[0][3],
             'xhost': multi_tab[0][1],
             'xua': multi_tab[0][4]
         })
     else:
         for elm in multi_tab:
             self.addDir({
                 'import': cItem['import'],
                 'category': 'host2',
                 'title': elm[0],
                 'icon': cItem['icon'],
                 'xuser': elm[2],
                 'xpass': elm[3],
                 'xhost': elm[1],
                 'xua': elm[4],
                 'mode': '20'
             })
Ejemplo n.º 2
0
	def SearchResult(self,str_ch,page,extra):
		multi_tab=xtream_get_conf()
		for elm in multi_tab:
			xhost_=elm[1]
			self.addMarker({'title':' ** '+elm[0]+' ** ','icon':'','desc':''})	
			try:
				Url=xhost_+'/player_api.php?username='******'&password='******'&action=get_vod_streams'
				sts, data = self.cm.getPage(Url)
				data = json_loads(data)
				printDBG('fffffffffffff'+str_ch.lower())
				
				for elm0 in data:
					if str_ch.lower() in elm0['name'].lower():
						Url=xhost_+'/movie/'+elm[2]+'/'+elm[3]+'/'+str(elm0['stream_id'])+'.'+elm0['container_extension']
						if elm[4]!='': Url  = strwithmeta(Url,{'User-Agent' : elm[4]})
						if elm0['stream_icon']: stream_icon =elm0['stream_icon']
						else: stream_icon = ''
						if elm0['rating']: rating = str(elm0['rating'])
						else: rating = ''			
						self.addVideo({'import':extra,'good_for_fav':True,'name':'categories','category' : 'video','url': Url,'title':elm0['name'],'icon':stream_icon,'desc':'Rating: '+rating,'hst':'direct'})	
			except:
				pass
			try:				
				Url=xhost_+'/player_api.php?username='******'&password='******'&action=get_series'
				sts, data = self.cm.getPage(Url)
				data = json_loads(data)
				for elm0 in data:
					if str_ch.lower() in elm0['name'].lower():
						if elm0['cover']: stream_icon =elm0['cover']
						else: stream_icon = ''
						if elm0['rating']: rating = str(elm0['rating'])
						else: rating = ''
						if elm0['plot']: plot = str(elm0['plot'])
						else: plot = ''
						if elm0['genre']: genre = str(elm0['genre'])
						else: genre = ''
						desc = 'GENRE:'+genre+' RATING:'+rating+'/10 \nPlot: '+plot
						self.addDir({'import':extra,'good_for_fav':True,'name':'categories','category' : 'host2','url': str(elm0['series_id']),'title':elm0['name'],'icon':stream_icon,'desc':desc,'xuser':elm[2],'xpass':elm[3],'xhost':xhost_,'xua':elm[4],'mode':'23'})
			except:
				pass