def play(self, params): stream = self.resolve(params['play']) print type(stream) if type(stream) == type([]): sdict={} for s in stream: if s['surl'] not in sdict: sdict[s['surl']] = s if len(sdict) > 1: break else: return xbmcprovider.XBMCMultiResolverContentProvider.play(self,params) # resolved to mutliple files, we'll feed playlist and play the first one playlist = [] i = 0 for video in stream: i += 1 if 'headers' in video.keys(): playlist.append(xbmcutil.create_play_it(params['title'] + " [" + str(i) + "]", "", video['quality'], video['url'], subs=video['subs'], filename=params['title'], headers=video['headers'])) else: playlist.append(xbmcutil.create_play_it(params['title'] + " [" + str(i) + "]", "", video['quality'], video['url'], subs=video['subs'], filename=params['title'])) xbmcutil.add_playlist(params['title'], playlist) elif stream: if 'headers' in stream.keys(): xbmcutil.add_play(params['title'], "", stream['quality'], stream['url'], subs=stream['subs'], filename=params['title'], headers=stream['headers']) else: xbmcutil.add_play(params['title'], "", stream['quality'], stream['url'], subs=stream['subs'], filename=params['title'])
def play(self, params): data = self.resolve(params['play']) if data is not None: if type(data) == type([]): for item in data: xbmcutil.add_play(params['title'], item['title'], item['quality'], item['url'], subs=self.get_subtitle(item['subs'], item.get('headers')), filename=params['title'], headers=item.get('headers',dict()), lang=item.get('lang',''), resolveTitle = item.get('resolveTitle',''), customTitle = item.get('customTitle',''), customFname = item.get('customFname',''), addonDataItem = item.get('customDataItem','')) else: xbmcutil.add_play(params['title'], data['title'], data['quality'], data['url'], subs=self.get_subtitle(data['subs'], data.get('headers')), filename=params['title'], headers=data.get('headers',dict()), lang=data.get('lang',''), resolveTitle = data.get('resolveTitle',''), customTitle = data.get('customTitle',''), customFname = data.get('customFname',''), addonDataItem = data.get('customDataItem',''))
def play(self, params): data = self.resolve(params['play']) if data is not None: if type(data) == type([]): for item in data: xbmcutil.add_play( params['title'], item['title'], item['quality'], item['url'], subs=self.get_subtitle(item['subs'], item.get('headers')), filename=params['title'], headers=item.get('headers', dict()), lang=item.get('lang', ''), resolveTitle=item.get('resolveTitle', ''), customTitle=item.get('customTitle', ''), customFname=item.get('customFname', ''), addonDataItem=item.get('customDataItem', '')) else: xbmcutil.add_play(params['title'], data['title'], data['quality'], data['url'], subs=self.get_subtitle( data['subs'], data.get('headers')), filename=params['title'], headers=data.get('headers', dict()), lang=data.get('lang', ''), resolveTitle=data.get('resolveTitle', ''), customTitle=data.get('customTitle', ''), customFname=data.get('customFname', ''), addonDataItem=data.get('customDataItem', ''))
def play(self, params): streams = self.resolve(params['play']) if streams is not None: if type(streams) == type([]): for stream in streams: xbmcutil.add_play(params['title'], stream['title'], stream['quality'], stream['url'], subs=self.get_subtitle( stream['subs'], stream.get('headers')), filename=params['title'], headers=stream.get('headers', dict()), lang=stream.get('lang', '')) else: xbmcutil.add_play(params['title'], streams['title'], streams['quality'], streams['url'], subs=self.get_subtitle( streams['subs'], streams.get('headers')), filename=params['title'], headers=streams.get('headers', dict()), lang=streams.get('lang', ''))
def play(self, params): streams = self.resolve(params['play']) if streams is not None: if type(streams) == type([]): for stream in streams: xbmcutil.add_play(params['title'], stream['title'], stream['quality'], stream['url'], subs=stream['subs'], filename=params['title'], headers=stream.get('headers',dict()), lang=stream.get('lang','')) else: xbmcutil.add_play(params['title'], streams['title'], streams['quality'], streams['url'], subs=streams['subs'], filename=params['title'], headers=streams.get('headers',dict()), lang=streams.get('lang',''))