def watch_live_hd(): rtmpurl = 'rtmp://aljazeeraflashlivefs.fplive.net:1935/aljazeeraflashlive-live/aljazeera_eng_high live=true' li = xbmcgui.ListItem('AlJazeera HD Live') xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(rtmpurl, li) # Return an empty list so we can test with plugin.crawl() and # plugin.interactive() return []
def watch_live(): rtmpurl = 'rtmp://aljazeeraflashlivefs.fplive.net:443/aljazeeraflashlive-live?videoId=883816736001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId=/aljazeera_eng_med?videoId=883816736001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId= live=true' li = xbmcgui.ListItem('AlJazeera Live') xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(rtmpurl, li) # Return an empty list so we can test with plugin.crawl() and # plugin.interactive() return []
def tvPlay(url, title, show_title, tracking_key): player = Player() if title: li = xbmcgui.ListItem(label=show_title + ' ' + title) player.play(url, li) else: player.play(url) player.is_playing = True player.tracking_key = tracking_key now = datetime.datetime.today() str_time = int(time.mktime(now.timetuple())) counter = 0 while (player.is_playing): if player.isPlaying(): player.info = { 'key': tracking_key, 'stream_started': str_time, 'current_time': int(player.getTime()), } if counter == 120 and tracking_key is not None: counter = 0 player.reportPlaybackProgress(player.info, 'progress') counter += 1 xbmc.sleep(1000) del player return
def tvPlay(url, title, show_title): if title: li = xbmcgui.ListItem(label=show_title + ' ' + title) xbmc.Player().play(url, li) else: xbmc.Player().play(url) return
def playVideoStream(tv_username, tv_password, issue_id, tvstation_name, stream_duration): log('Start playVideoStream') # get a neterra class Neterra = neterra(tv_username, tv_password) html = Neterra.openContentStream(Neterra.CONTENTURL + Neterra.GETSTREAM, 'issue_id=' + issue_id) jsonResponse = json.loads(html) log('playVideoStream json response: ' + str(jsonResponse)) # parse html for flashplayer link tcUrl = jsonResponse['play_link'] playpath = jsonResponse['file_link'] isLive = jsonResponse['live'] if "dvr" in tcUrl: # apapt tcUrl for DVR streams tcUrl = tcUrl.replace('/dvr', '/live') tcUrl = tcUrl.replace('DVR&', '') tcUrl = tcUrl.replace(':443', ':80') # log some details log('playpath: ' + playpath) log('tcUrl: ' + tcUrl) playUrl = tcUrl + ' ' + neterra.SWFPLAYERURL + ' playpath=' + playpath + ' ' + neterra.SWFPAGEURL + ' ' + neterra.SWfVfy + ' live=' + isLive + ' ' + neterra.SWFBUFFERDEFAULT listitem = xbmcgui.ListItem(label=str(tvstation_name)) if stream_duration: log("Stream duration: " + str(stream_duration)) listitem.setInfo('video', { 'title': tvstation_name, 'duration': stream_duration }) xbmc.Player().play(playUrl, listitem) log('URL: ' + playUrl) log('Finished playVideoStream') html = '' return html
def set_resolved_url(self, url, title=None): if self._mode in ['crawl', 'interactive', 'test']: print 'ListItem resolved to %s' % url li = xbmcgui.ListItem(path=url) if title: li.setLabel(title) xbmcplugin.setResolvedUrl(self.handle, True, li) if self._mode in ['interactive', 'crawl', 'test']: return []
def set_resolved_url(self, url): if self._mode in ['crawl', 'interactive', 'test']: print 'ListItem resolved to %s' % url li = xbmcgui.ListItem(path=url) xbmcplugin.setResolvedUrl(self.handle, True, li) # CLI modes expect a list to be returned. if self._mode in ['interactive', 'crawl', 'test']: return []
def addDir2(name,url,mode,poster,fanart,thumb,banner,itemcount): contextMenuItems = [] contextMenuItems.append(('Movie Information', 'XBMC.Action(Info)')) u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name) ok=True liz=xbmcgui.ListItem(name, iconImage=thumb, thumbnailImage=thumb) liz.setArt({ 'thumb': thumb, 'poster': poster, 'fanart' : fanart, 'banner ' : banner }) liz.addContextMenuItems(contextMenuItems, replaceItems=False) liz.setProperty('fanart_image', fanart) ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True,totalItems=itemcount) return ok
def addDir(name,url,mode,iconimage,fanart,description): xbmc.log(url) u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&iconimage="+urllib.quote_plus(iconimage)+"&description="+urllib.quote_plus('') ok=True liz=xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage) liz.setInfo( type="Video", infoLabels={ "Title": name,"Plot":description} ) liz.setProperty('fanart_image', fanart) liz.setProperty('tvshowthumb', iconimage) liz.setProperty( "player.art", iconimage) ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True) return ok
def _make_listitem(self, label, label2='', iconImage='', thumbnail='', path='', **options): li = xbmcgui.ListItem(label, label2=label2, iconImage=iconImage, thumbnailImage=thumbnail, path=path) cleaned_info = clean_dict(options.get('info')) if cleaned_info: li.setInfo('video', cleaned_info) if options.get('is_playable'): li.setProperty('IsPlayable', 'true') if options.get('context_menu'): li.addContextMenuItems(options['context_menu']) return options['url'], li, options.get('is_folder', True)
def play_live(url, title, thumb, chid, usern, passwd): if usern != '': auth_resp = auth.doAuth(usern, passwd) if auth_resp < 100: xbmcgui.Dialog().ok( "Autorizacija nije uspješna", "Niste unijeli korisničke podatke ili uneseni podaci nisu tačni.\n\nNakon što kliknete OK otvoriće Vam se postavke te je neophodno da unesete ispravno korisničko ime i lozinku za Moja webTV servis " ) xbmcaddon.Addon(id='plugin.video.mojawebtv').openSettings() if auth_resp > 99: li = xbmcgui.ListItem(label=title, thumbnailImage=thumb) li.setInfo(type='Video', infoLabels={"Title": title}) li.setProperty('IsPlayable', 'true') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) if usern == '': li = xbmcgui.ListItem(label=title, thumbnailImage=thumb) li.setInfo(type='Video', infoLabels={"Title": title}) li.setProperty('IsPlayable', 'true') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) # Return an empty list so we can test with plugin.crawl() and # plugin.interactive() return []
def _make_listitem(self, label, path='', **options): li = xbmcgui.ListItem(label, path=path) cleaned_info = clean_dict(options.get('info')) li.setArt({ 'poster': options.get('thumb'), 'thumb': options.get('thumb') }) li.setInfo( 'video', { 'originaltitle': label, 'title': label, 'sorttitle': options.get('key') }) return options['url'], li, options.get('is_folder', True)
def _make_listitem(self, label, label2='', iconImage='', thumbnail='', path='', **options): li = xbmcgui.ListItem(label, label2=label2, iconImage=iconImage, thumbnailImage=thumbnail, path=path) cleaned_info = clean_dict(options.get('info')) if cleaned_info: li.setInfo('video', cleaned_info) if options.get('is_playable'): li.setProperty('IsPlayable', 'true') if options.get('context_menu'): li.addContextMenuItems(options['context_menu']) #endpoint = options['context_menu'].get('add_to_playlist') #if endpoint: #keys = ['label', 'label2', 'icon', 'thumbnail', 'path', 'info'] # need the url for calling add_to_playlist this is thwat gets added to the context menu # need the current url for the item, it will be encoded in teh url for calling add_to_playlist # also other info in [keys] will be added to teh add_to_playlist url's qs so we can recreate the listitem # perhaps try pickling the listitem? #current_url = options.get('url') #context_menu_url = self.url_for(endpoint, url=options.get('url'), label=label, label2=label2, iconImage=iconImage, thumbnail=thumbnail) #li.addContextMenuItems([('Add to Playlist', 'XBMC.RunPlugin(%s)' % context_menu_url)]) #return li return options['url'], li, options.get('is_folder', True)
def landau(): url = 'mms://streaming.ok54.de/okweinstrasse' li = xbmcgui.ListItem('Landau, Neustadt & Haßloch') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def link(url): liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={'Title':description}) liz.setProperty("IsPlayable","true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
def pirmasens(): url = 'mms://streaming.ok54.de/suedwestpfalz-tv' li = xbmcgui.ListItem('Pirmasens, Rodalben & Zweibrücken') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def speyer(): url = 'http://s2.fairprice-streams.de:9420/;stream.nsv' li = xbmcgui.ListItem('Speyer') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def salzwedel(): url = 'http://62.113.210.250/medienasa-live/_definst_/mp4:ok-salzwedel_high/playlist.m3u8' li = xbmcgui.ListItem('Salzwedel') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def trier(): url = 'mms://streaming.ok54.de/ok54' li = xbmcgui.ListItem('Trier') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def merseburg(): url = 'http://62.113.210.250/medienasa-live/_definst_/mp4:ok-merseburg_high/playlist.m3u8' li = xbmcgui.ListItem('Merseburg') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def wernigerode(): url = 'http://62.113.210.250/medienasa-live/_definst_/mp4:ok-wernigerode_high/playlist.m3u8' li = xbmcgui.ListItem('Wernigerode') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def berlin(): url = 'http://alex-stream.rosebud-media.de:1935/live/alexlivetv.smil/playlist.m3u8' li = xbmcgui.ListItem('Berlin') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []
def dessau(): url = 'http://62.113.210.250/medienasa-live/_definst_/mp4:ok-dessau_high/playlist.m3u8' li = xbmcgui.ListItem('Dessau') xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) return []