def PlayB(name,url): ok=True hname=name name = name.split('[COLOR blue]')[0] name = name.split('[COLOR red]')[0] infoLabels = main.GETMETAT(name,'','','') video_type='movie' season='' episode='' img=infoLabels['cover_url'] fanart =infoLabels['backdrop_url'] imdb_id=infoLabels['imdb_id'] infolabels = { 'supports_meta' : 'true', 'video_type':video_type, 'name':str(infoLabels['title']), 'imdb_id':str(infoLabels['imdb_id']), 'season':str(season), 'episode':str(episode), 'year':str(infoLabels['year']) } try: xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = main.resolve_url(url) infoL={'Title': infoLabels['metaName'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']} # play with bookmark player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']),season=str(season), episode=str(episode), year=str(infoLabels['year']),img=img,infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams,imdb_id=imdb_id) #WatchHistory if selfAddon.getSetting("whistory") == "true": wh.add_item(hname+' '+'[COLOR green]Movie25[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def PLAYB(name, url): ok = True hname = name name = name.split('[COLOR blue]')[0] name = name.split('[COLOR red]')[0] infoLabels = main.GETMETAT(name, '', '', '') video_type = 'movie' season = '' episode = '' img = infoLabels['cover_url'] fanart = infoLabels['backdrop_url'] imdb_id = infoLabels['imdb_id'] infolabels = { 'supports_meta': 'true', 'video_type': video_type, 'name': str(infoLabels['title']), 'imdb_id': str(infoLabels['imdb_id']), 'season': str(season), 'episode': str(episode), 'year': str(infoLabels['year']) } try: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = urlresolver.resolve(url) infoL = { 'Title': infoLabels['metaName'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'] } # play with bookmark from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']), season=str(season), episode=str(episode), year=str(infoLabels['year']), img=img, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id=imdb_id) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def PLAY(name, murl): main.GA("Movie25-Movie", "Watched") ok = True hname = name name = name.split('[COLOR blue]')[0] name = name.split('[COLOR red]')[0] infoLabels = main.GETMETAB(name, '', '', '') link = main.OPENURL(murl) match = re.compile("Javascript:location.?href=.+?'(.+?)\'").findall(link) for murl in match: print murl video_type = 'movie' season = '' episode = '' img = infoLabels['cover_url'] fanart = infoLabels['backdrop_url'] imdb_id = infoLabels['imdb_id'] infolabels = { 'supports_meta': 'true', 'video_type': video_type, 'name': str(infoLabels['title']), 'imdb_id': str(infoLabels['imdb_id']), 'season': str(season), 'episode': str(episode), 'year': str(infoLabels['year']) } media = urlresolver.HostedMediaFile(murl) source = media try: if source: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = source.resolve() else: stream_url = False infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'] } # play with bookmark player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']), season=str(season), episode=str(episode), year=str(infoLabels['year']), img=img, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id=imdb_id) #WatchHistory if selfAddon.getSetting("whistory") == "true": wh.add_item(hname + ' ' + '[COLOR green]Movie25[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def PlayB(name, url): ok = True namelist = [] urllist = [] infoLabels = main.GETMETAT(name, '', '', '') video_type = 'show' season = '' episode = '' img = infoLabels['cover_url'] fanart = infoLabels['backdrop_url'] imdb_id = infoLabels['imdb_id'] infolabels = { 'supports_meta': 'true', 'video_type': video_type, 'name': str(infoLabels['title']), 'imdb_id': str(infoLabels['imdb_id']), 'season': str(season), 'episode': str(episode), 'year': str(infoLabels['year']) } link = main.OPENURL(url) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('\/', '/').replace('\\', '=') match = re.compile('url_encoded_fmt_stream_map\":\"(.+?),\"').findall(link) if match: streams_map = str(match) stream = re.compile( 'url=u003d(.+?)=u0026type=u003d.+?=u0026quality=u003d(.+?),itag' ).findall(streams_map) for group1, group2 in stream: #Thanks to the-one for google-doc resolver stream_url = str(group1) stream_url = unescape(stream_url) urllist.append(stream_url) stream_qlty = str(group2.upper()) if (stream_qlty == 'HD720'): stream_qlty = 'HD-720p' elif (stream_qlty == 'LARGE'): stream_qlty = 'SD-480p' elif (stream_qlty == 'MEDIUM'): stream_qlty = 'SD-360p' namelist.append(stream_qlty) dialog = xbmcgui.Dialog() answer = dialog.select("Quality Select", namelist) if answer != -1: try: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url2 = urllist[int(answer)] infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'] } # play with bookmark from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url2, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']), season=str(season), episode=str(episode), year=str(infoLabels['year']), img=img, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id=imdb_id) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok