def COUNTRIESLink(mname,url,thumb): ok = True if '.f4m'in url: from resources.universal import F4mProxy player=F4mProxy.f4mProxyHelper() proxy=None use_proxy_for_chunks=False player.playF4mLink(url, mname, proxy, use_proxy_for_chunks,'',thumb) if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname+' '+'[COLOR green]My Country[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) else: if '</regex>'in url: url=main.doRegex(url) stream_url = url playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() listitem = xbmcgui.ListItem(thumbnailImage=thumb) infoL={'Title': mname, 'Genre': 'Live'} from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type='movie', title=mname,season='', episode='', year='',img=thumb,infolabels=infoL, watchedCallbackwithParams='',imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname+' '+'[COLOR green]My Country[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def VIPLink(mname, murl, thumb): main.GA(mname, "Watched") ok = True namelist = [] urllist = [] playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() if '.f4m' in murl: from resources.universal import F4mProxy player = F4mProxy.f4mProxyHelper() proxy = None use_proxy_for_chunks = False player.playF4mLink(murl, mname, proxy, use_proxy_for_chunks, '', thumb) if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]Live[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) else: if '</regex>' in murl: murl = main.doRegex(murl) match = re.compile('<sublink>(.+?)</sublink>').findall(murl) if match: i = 1 for url in match: name = 'Link ' + str(i) namelist.append(name) urllist.append(url) i = i + 1 dialog = xbmcgui.Dialog() answer = dialog.select("Pick A Link", namelist) if answer != -1: murl = urllist[int(answer)] xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Opening Link,5000)") else: return stream_url = murl listitem = xbmcgui.ListItem(thumbnailImage=thumb) listitem.setInfo('video', {'Title': mname, 'Genre': 'Live'}) playlist.add(stream_url, listitem) xbmcPlayer = xbmc.Player() xbmcPlayer.play(playlist) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]Live[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def PLAYLINK(mname, murl, thumb): ok = True main.GA("Live", "SportsAccess") stream_url = get_link(murl) playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() listitem = xbmcgui.ListItem(thumbnailImage=thumb) infoL = {'Title': mname, 'Genre': 'Live'} from resources.universal import playbackengine, watchhistory player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='movie', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams='', imdb_id='') wh = watchhistory.WatchHistory('plugin.video.movie25') #WatchHistory if selfAddon.getSetting("whistory") == "true": wh.add_item(mname + ' ' + '[COLOR green]' + prettyName + '[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def SKYSPORTSLink(mname, murl): main.GA("SkySports", "Watched") xbmc.executebuiltin("XBMC.Notification(Please Wait!,Playing Video,1500)") ok = True link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile('data-video-id="([^"]+?)"').findall(link) vlink = 'http://cf.c.ooyala.com/' + match[0] + '/' + match[0] + '_1.f4m' desc = re.compile('<meta name="description" content="(.+?)"/>').findall( link) thumb = re.compile("<link rel='image_src' href='([^']+?)' />").findall( link)[0] print infoL = {"Title": mname, "Plot": desc[0]} from resources.universal import F4mProxy player = F4mProxy.f4mProxyHelper() proxy = None use_proxy_for_chunks = False player.playF4mLink(vlink, mname, proxy, use_proxy_for_chunks, '', thumb) if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(mname + ' ' + '[COLOR green]SkySports[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infoL, img=thumb, fanart='', is_folder=False)
def LINKSP5(mname, url): main.GA("Noobroom", "Watched") ok = True try: mname = mname.replace('[COLOR red]', '').replace('[/COLOR]', '') xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Opening Link,9000)") stream_url = find_noobroom_video_url(url) infoLabels = main.GETMETAT(mname, '', '', '') 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']) } infoL = { 'Title': infoLabels['title'], '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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR=FF67cc33]Starplay[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infolabels, img=img, fanart='', is_folder=False) player.KeepAlive() return ok except Exception, e: main.ErrorReport(e) return ok
def PLAYLINK(mname, murl): name = main.removeColoredText(mname) main.GA("IceFilms", "Watched") ok = True infoLabels = main.GETMETAT(mname, '', '', '') video_type = 'movie' season = '' episode = '' img = infoLabels['cover_url'] fanart = infoLabels['backdrop_url'] imdb_id = infoLabels['imdb_id'] murl = resolveIceLink(murl) 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(murl) infoL = { 'Title': name, '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=name, 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": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]IceFilms[/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 LINK(name, murl, thumb): xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)") main.GA("Yify", "Watched") stream_url = False ok = True infoLabels = main.GETMETAT(name, '', '', thumb) 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']) } stream_url = main.resolve_url(murl) try: infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName'] } # play with bookmark from resources.universal import playbackengine if stream_url: main.CloseAllDialogs() player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=infoLabels['title'], season=season, episode=episode, year=str(infoLabels['year']), img=img, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id=imdb_id) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(name + ' ' + '[COLOR green]Yify[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=img, fanart='', is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def LINK(mname, murl, thumb): main.GA("SportsPack", "Watched") stream_url = False xbmc.executebuiltin("XBMC.Notification(Please Wait!,Opening Stream,3000)") ok = True stream_url = murl listitem = xbmcgui.ListItem(thumbnailImage=thumb) infoL = {'Title': mname, 'Genre': 'Live'} from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='movie', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams='', imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]SportsPack[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def LINK(mname, murl, thumb): main.GA(mname, "Watched") ok = True namelist = [] urllist = [] playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() stream_url = murl + '|User-Agent=PS4 libhttp/1.60 (PlayStation 4)' listitem = xbmcgui.ListItem(thumbnailImage=thumb) infoL = {'Title': mname, 'Genre': 'Live'} from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='movie', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams='', imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]NHL[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def History(): whprofile = xbmc.translatePath(selfAddon.getAddonInfo('profile')) whdb=os.path.join(whprofile,'Universal','watch_history.db') if os.path.exists(whdb): main.addPlayc('Clear Watch History',whdb,414,art+'/cleahis.png','','','','','') from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) if selfAddon.getSetting("whistory") == "true": history_items = wh.get_my_watch_history() for item in history_items: item_title = item['title'] item_url = item['url'] item_image = item['image_url'] item_fanart = item['fanart_url'] item_infolabels = item['infolabels'] item_isfolder = item['isfolder'] if item_image =='': item_image= art+'/noimage.png' item_title=item_title.replace('[COLOR green]','[COLOR=FF67cc33]') main.addLink(item_title,item_url,item_image) else: dialog = xbmcgui.Dialog() ok=dialog.ok('[B]Aftershock History[/B]', 'Watch history is disabled' ,'To enable go to addon settings','and enable Watch History') history_items = wh.get_my_watch_history() for item in history_items: item_title = item['title'] item_url = item['url'] item_image = item['image_url'] item_fanart = item['fanart_url'] item_infolabels = item['infolabels'] item_isfolder = item['isfolder'] item_title=item_title.replace('[COLOR green]','[COLOR=FF67cc33]') main.addLink(item_title,item_url,item_image)
def LINK(name,murl,thumb): xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)") main.GA(prettyName,"Watched") stream_url = False ok=True infoLabels =main.GETMETAT(name,'','',thumb) 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']) } link=main.OPENURL(murl) keys=re.findall('(?sim)vkey=(.+?)&',link) if keys: vurl='http://www.pinit.tv/embedplayer.php?width=620&height=465&vkey='+keys[0]+'&autoplay=true&subtitles=' link=main.OPENURL(vurl) key=re.findall('href="(rtmp://[^"]+?)">Play',link) stream_url = key[0] id=re.findall('rtmp://.+?/pinit/(\d+)_.+?.mp4',key[0])[0] else: urllist=[] epiList=[] match=re.findall('(?sim)<a href="([^"]+?)" target="_blank">([^<]+?)</a>',link) for url,epi in match: urllist.append(url) epiList.append(epi) dialog = xbmcgui.Dialog() ret = dialog.select('[COLOR=FF67cc33][B]Select Episode[/COLOR][/B]',epiList) if ret == -1: return link2=main.OPENURL(urllist[ret]) key=re.findall('href="(rtmp[^"]+?)">Play',link2) stream_url = key[0] id=re.findall('rtmp://.+?/pinit/(\d+)_.+?.mp4',key[0])[0] name=epiList[ret] try: infoL={'Title': name, 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName']} # play with bookmark from resources.universal import playbackengine if stream_url: main.CloseAllDialogs() player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=infoLabels['title'],season=season, episode=episode, year=str(infoLabels['year']),img=img,infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams,imdb_id=imdb_id) player.setSubtitles('http://www.pinit.tv/subs/'+id+'.srt') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(name+' '+'[COLOR green]'+prettyName+'[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=img, fanart='', is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def LINKFMA(mname,murl,thumb,desc): main.GA("FMA","Watched") sources = [] ok=True playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() xbmc.executebuiltin("XBMC.Notification(Please Wait!,Collecting hosts,3000)") infoLabels =main.GETMETAT(mname,'','',thumb) 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']) } link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match=re.compile('<span class=\'.+?\'>(.+?)</span></p><div class=\'.+?\'><img src=\'.+?\' /></div><a class=\'.+?\' href="(.+?)"').findall(link) import urlresolver for host, url in match: durl='http://www.freemoviesaddict.com/'+url redirect=main.REDIRECT(durl) hosted_media = urlresolver.HostedMediaFile(url=redirect, title=host) sources.append(hosted_media) if (len(sources)==0): xbmc.executebuiltin("XBMC.Notification(Sorry!,Show doesn't have playable links,5000)") else: source = urlresolver.choose_source(sources) if source != False: try: xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = main.resolve_url(source.get_url()) if(stream_url == False): return infoL={'Title': infoLabels['title'], '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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(mname+' '+'[COLOR green]FMA[/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 LINK(mname, murl, thumb): main.GA("MLB", "Watched") strmL = [] link = main.OPENURL(murl) ok = True link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') m3u8 = re.compile( '''cdn="AKAMAI_FLASH_STREAM_ONDEMAND">([^<]*tablet.m3u8)<''').findall( link) link2 = main.OPENURL(m3u8[0]) links = re.compile("(.+?m3u8)").findall(link2) stmUrl = m3u8[0].replace('master_tablet.m3u8', '') for strm in links: strmL.append(strm) if selfAddon.getSetting("disj-qua") == "0": stream_url = stmUrl + strmL[0] elif selfAddon.getSetting("disj-qua") == "1": stream_url = stmUrl + strmL[1] elif selfAddon.getSetting("disj-qua") == "2": stream_url = stmUrl + strmL[2] listitem = xbmcgui.ListItem(mname, thumbnailImage=thumb) infoL = {'Title': mname, 'Genre': 'Live'} from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='movie', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams='', imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import playbackengine, watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]MLB[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def LINKS3arabtv(mname, murl, thumb): main.GA("3Arabtv", "Watched") xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)") link = main.OPENURL(murl) ok = True match = re.compile('<iframe id="playerframe" src="([^<]+)"', re.DOTALL).findall(link) if match: stream_url = resolveVID(MAINURL + match[0].replace('/inter.php?u=', '')) else: return try: if stream_url == False: return infoL = { 'Title': mname, 'Plot': '', 'Genre': '', 'originaltitle': mname } # play with bookmark stream_url = stream_url.replace(' ', '%20') from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(mname + ' ' + '[COLOR green]3Arabtv[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) player.KeepAlive() return True except Exception, e: if stream_url != False: main.ErrorReport(e) return False
def PLAY(mname,murl,thumb): main.GA("Dramania","Watched") ok=True r = re.findall('(.+?)\ss(\d+)e(\d+)\s',mname,re.I) if r: infoLabels =main.GETMETAEpiT(mname,'','') video_type='episode' season=infoLabels['season'] episode=infoLabels['episode'] else: infoLabels =main.GETMETAT(mname,'','',thumb) 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)") infoL={'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre']} if not video_type is 'episode': infoL['originalTitle']=main.removeColoredText(infoLabels['metaName']) from resources.universal import playbackengine if "'," in murl: mname=main.removeColoredText(mname) pl=xbmc.PlayList(1);pl.clear() playlist = sorted(list(set(eval(murl))), key=lambda playlist: playlist[0]) for xname,link in playlist: pl.add(getLink(link),xbmcgui.ListItem(mname+' '+xname,thumbnailImage=img)) xbmc.Player().play(pl) while xbmc.Player().isPlaying(): xbmc.sleep(2500) else: stream_url = getLink(murl) # play with bookmark player = playbackengine.PlayWithoutQueueSupport(resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=infoLabels['title'],season=season, episode=episode, year=str(infoLabels['year']),img=img,infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams,imdb_id=imdb_id) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(mname+' '+'[COLOR green]Dramania[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=infoLabels['cover_url'], fanart=infoLabels['backdrop_url'], is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def VIDEOLINKS(mname,url): ok=True hname=mname hname=hname.split(' online')[0] xbmc.executebuiltin("XBMC.Notification(Please Wait!,Opening Link,3000)") r=re.findall('Season(.+?)Episode([^<]+)',mname) if r: mname=mname.split(' [COLOR blue]')[0] infoLabels =main.GETMETAEpiT(mname,'','') video_type='episode' season=infoLabels['season'] episode=infoLabels['episode'] else: mname=mname.split(' [COLOR blue]')[0] infoLabels =main.GETMETAT(mname,'','','') 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']) } r=re.findall('xoxv(.+?)xoxe(.+?)xoxc',url) import urlresolver for hoster, url in r: source = urlresolver.HostedMediaFile(host=hoster, media_id=url) try : xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = main.resolve_url(source.get_url()) if(stream_url == False): return infoL={'Title': infoLabels['title'], '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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import playbackengine, watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(hname+' '+'[COLOR=FF67cc33]TubePlus[/COLOR]', sys.argv[0]+sys.argv[2], infolabels=infolabels, img=str(img), fanart=str(fanart), is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def iLiveLink(mname, murl, thumb): main.GA("iLive", "Watched") stream_url = False xbmc.executebuiltin("XBMC.Notification(Please Wait!,Opening Stream,3000)") link = main.OPENURL(murl) ok = True if link: playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace("\/", '/') rtmp = re.compile('''streamer: "([^"]+?)"''').findall(link) app = rtmp[0].split('?xs=') playpath = re.compile('''file: "([^"]+?).flv"''').findall(link) token = getToken(murl) stream_url = rtmp[0] + ' app=edge/?xs=' + app[1] + ' playpath=' + playpath[ 0] + ' swfUrl=http://cdn.ilive.to/player/player_ilive_2.swf pageUrl=http://www.ilive.to/ live=true timeout=10 token=' + token listitem = xbmcgui.ListItem(thumbnailImage=thumb) infoL = {'Title': mname, 'Genre': 'Live'} from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='movie', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams='', imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]iLive[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def LINKSMAILRU(mname, murl, thumb): main.GA("MailRu", "Watched") xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)") link = main.OPENURL(murl) ok = True stream_url = resolve_mailru(murl) try: if stream_url == False: return infoL = { 'Title': mname, 'Plot': '', 'Genre': '', 'originaltitle': mname } # play with bookmark stream_url = stream_url.replace(' ', '%20') from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) #wh.add_item(mname+' '+'[COLOR green]MAILRU[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) player.KeepAlive() return True except Exception, e: if stream_url != False: main.ErrorReport(e) return False
def PLAYPFTV(mname,murl): host=murl.split('x1x8x')[0] media_id=murl.split('x1x8x')[1] main.GA(prettyName,"Watched") ok=True xbmc.executebuiltin("XBMC.Notification(Please Wait!,Checking Link,3000)") #furl=geturl(murl) infoLabels =main.GETMETAEpiT(mname,'','') video_type='episode' season=infoLabels['season'] episode=infoLabels['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)") import urlresolver source = urlresolver.HostedMediaFile(host=host, media_id=media_id) if source: stream_url = source.resolve() infoL={'Title': infoLabels['title'], '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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname+' '+'[COLOR green]PFTV[/COLOR]', sys.argv[0]+sys.argv[2], infolabels='', img=img, fanart='', is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def LINKSP3(mname, url): main.GA("Dailyfix", "Watched") sources = [] ok = True xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Collecting Hosts,8000)") infoLabels = main.GETMETAT(mname, '', '', '') 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']) } link = main.OPENURL(url) match = re.compile( "<a href='(.+?)' class='.+?' title='.+?' rel='.+?'>.+?</a").findall( link) import urlresolver main.CloseAllDialogs() for murl in match: host = re.compile("http://(.+?)\.[^/]+?/.+?").findall(murl) for hname in host: hname = hname.replace('www.', '').title() hosted_media = urlresolver.HostedMediaFile(url=murl, title="[COLOR blue]" + hname + "[/COLOR]") sources.append(hosted_media) if (len(sources) == 0): xbmc.executebuiltin( "XBMC.Notification(Sorry!,Movie doesn't have playable links,5000)") else: source = urlresolver.choose_source(sources) try: if source: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Actual HD Movie Requires Buffer Time,7000)" ) stream_url = main.resolve_url(source.get_url()) else: stream_url = False return infoL = { 'Title': infoLabels['title'], '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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]DailyFix[/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 LINKSP3(mname, murl): main.GA("DL4Free", "Watched") msg = xbmcgui.DialogProgress() msg.create('Please Wait!', '') msg.update(0, 'Collecting hosts') link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('&', '&') sources = [] titles = [] ok = True match0 = re.compile( '(?sim)<div class="meta">Download Links</div>.*?</div>').findall(link) match1 = [] match2 = [] if match0: match2 = re.compile('(?sim)<p.*?</p>').findall(match0[0]) for paragraph in reversed(match2): match1 += re.compile('<a href="([^"]+?)"').findall(paragraph) match = [] paragraphs = re.compile('(?sim)<code>.+?</code>').findall(link) for paragraph in paragraphs: domains = re.compile('https?://([^"]+?)/[^<^\]]+').findall(paragraph) urls = re.compile('(https?://[^"]+?/[^<^\]]+)').findall(paragraph) for d in domains: if domains.count(d) > 1: while d in domains: index = domains.index(d) domains.pop(index) urls.pop(index) match += urls # match=re.compile('<a href="([^<]+)">htt').findall(link) match = match1 + match mainlinks = len(match1) numpar = len(match2) hostsmax = len(match) h = 0 from urlparse import urlparse for url in match: h += 1 percent = (h * 100) / hostsmax msg.update(percent, 'Collecting hosts - ' + str(percent) + '%') if msg.iscanceled(): break vlink = re.compile('rar|part\d+?(\.html)?$|/folder/').findall(url) if len(vlink) == 0: firstword = mname.partition(' ')[0] if re.search('(?i)' + mname.partition(' ')[0], url): if re.search('(?i)1080p?', mname): if not re.search('(?i)1080p?', url): continue if re.search('(?i)720p', mname): if not re.search('(?i)720p?', url): continue if re.search('(?i)1080p?', mname): if re.search('(?i)720p|dvdrip|480p/|xvid', url): continue if re.search('(?i)720p?', mname): if re.search('(?i)1080p?|dvdrip|480p|xvid', url): continue if re.search('(?i)xvid|480p', mname) or not re.search('(?i)1080p?|720p?', mname): if re.search('(?i)1080p?|720p?', url): continue # url = url.replace('ul.to','uploaded.net') host = urlparse(url).hostname.replace('www.', '').partition('.')[0] hostname = host host = host.upper() if h <= mainlinks and numpar == 1: quality = mname else: quality = url match3 = re.compile('(?i)(720p?|1080p?)').findall(quality) if match3 and not 'p' in match3[0]: match3[0] += 'p' match4 = re.compile('mp4').findall(url) if len(match3) > 0: host = host + ' [COLOR red]' + match3[0] + '[/COLOR]' elif len(match4) > 0: host = host + ' [COLOR green]SD MP4[/COLOR]' else: host = host + ' [COLOR blue]SD[/COLOR]' if main.supportedHost(hostname): titles.append(host) sources.append(url) msg.close() if (len(sources) == 0): xbmc.executebuiltin( "XBMC.Notification(Sorry!,Could not find a playable link,3000)") return else: dialog = xbmcgui.Dialog() index = dialog.select('Choose your stream', titles) if index != -1: source = sources[index] else: source = None try: if not source: main.CloseAllDialogs() return xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,5000)") stream_url = main.resolve_url(source) if (stream_url == False): return if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I): mname = mname.split('&')[0] infoLabels = main.GETMETAEpiT(mname, '', '') video_type = 'episode' season = infoLabels['season'] episode = infoLabels['episode'] else: infoLabels = main.GETMETAT(mname, '', '', '') 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']) } infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName'] } if not video_type is 'episode': infoL['originalTitle'] = main.removeColoredText( infoLabels['metaName']) # 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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]DL4Free[/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
import urllib, urllib2, re, cookielib, urlresolver, os, sys import xbmc, xbmcgui, xbmcaddon, xbmcplugin from resources.libs import main #Mash Up - by Mash2k3 2012. from t0mm0.common.addon import Addon from resources.universal import playbackengine, watchhistory addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) addon = Addon(addon_id, sys.argv) art = main.art wh = watchhistory.WatchHistory(addon_id) def LISTFX(): urllist = [] page = 1 while page < 11: urllist.append('http://estrenosvk.com/ano/2014/' + str(page) + '/') page += 1 if urllist: html = main.batchOPENURL(urllist) urllist = main.unescapes(html) match = re.compile( '<a href="([^"]+)"><figure><img src="([^"]+)" alt="([^"]+)">', re.DOTALL).findall(urllist) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Movie list is cached.') totalLinks = len(match)
def LINK(mname, murl, thumb): main.GA(mname, "Watched") ok = True namelist = [] urllist = [] playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() if '_whole' in murl: link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace(' ', '') part = re.findall('/([^/]+)ipad.mp4.m3u8', murl)[0] match = re.compile('BANDWIDTH=.+?' + part + '(.+?)_ipad.mp4.m3u8', re.DOTALL).findall(link) for band in sorted(match): namelist.append(band) dialog = xbmcgui.Dialog() answer = dialog.select("Pick A Bandwidth", namelist) if answer != -1: nurl = murl.split('ipad.mp4.m3u8')[0] stream_url = nurl + namelist[int( answer )] + '_ipad.mp4.m3u8' + '|User-Agent=PS4 libhttp/1.76 (PlayStation 4)' else: return elif '/live/' in murl: import subprocess jarfile = xbmc.translatePath( 'special://home/addons/plugin.video.movie25/resources/libs/live/FuckNeulionV2.jar' ) if 'Home' in mname: Side = 'home' if 'Away' in mname: Side = 'away' SelectGame = murl.split('x0xe')[1] murl = murl.split('x0xe')[0] startupinfo = None if os.name == 'nt': startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW command = ['java', '-jar', jarfile, SelectGame, Side] proxy_hack_process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=startupinfo) xbmc.sleep(1000) link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace(' ', '') part = re.findall('/([^/]+)ipad.m3u8', murl)[0] match = re.compile('BANDWIDTH=.+?' + part + '(.+?)_ipad.m3u8', re.DOTALL).findall(link) for band in sorted(match): namelist.append(band) dialog = xbmcgui.Dialog() answer = dialog.select("Pick A Bandwidth", namelist) if answer != -1: nurl = murl.split('ipad.m3u8')[0] stream_url = nurl + namelist[int( answer )] + '_ipad.m3u8' + '|User-Agent=PS4 libhttp/1.76 (PlayStation 4)' else: return else: stream_url = murl + '|User-Agent=PS4 libhttp/1.76 (PlayStation 4)' listitem = xbmcgui.ListItem(thumbnailImage=thumb) infoL = {'Title': mname, 'Genre': 'Live'} from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='movie', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams='', imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]NHL[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) return ok
def PLAYMEDIA(name, url): ok = True r = re.findall(r'(.+?)\[COLOR', name) name = r[0] r = re.findall('Season(.+?)Episode([^<]+)', name) if r: infoLabels = main.GETMETAEpiT(name, '', '') video_type = 'episode' season = infoLabels['season'] episode = infoLabels['episode'] else: 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['title'], '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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(name + ' ' + '[COLOR=FF67cc33]TvRelease[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infolabels, img=str(img), fanart=str(fanart), is_folder=False) player.KeepAlive() return ok except: return ok
def MLink2(mname, murl, thumb, muvideo=False): main.GA(mname, "Watched") ok = True xbmc.executebuiltin("XBMC.Notification(Please Wait!,Opening Link,3000)") if not muvideo: match = re.compile('<referer>(.+?)</referer>').findall(murl) if match: video = match[0] else: video = murl infoLabels = main.GETMETAT(mname, '', '', '') 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: stream_url = refererResolver(video) if stream_url == False: return infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName'] } # play with bookmark stream_url = stream_url.replace(' ', '%20') 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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]VIPlaylist[/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
import urllib, urllib2, re, cookielib, os, sys import xbmc, xbmcgui, xbmcaddon, xbmcplugin import main #Megabox - by Kasik04a 2014. from t0mm0.common.addon import Addon from resources.universal import playbackengine, watchhistory addon_id = 'plugin.video.megabox' selfAddon = xbmcaddon.Addon(id=addon_id) addon = Addon('plugin.video.megabox', sys.argv) art = main.art wh = watchhistory.WatchHistory('plugin.video.megabox') DownloadLog = os.path.join(main.datapath, 'Downloads') DownloadFile = os.path.join(DownloadLog, 'DownloadLog') def LIST(): if os.path.exists(DownloadFile): DownloadLog = re.compile('{name="(.+?)",destination="(.+?)"}').findall( open(DownloadFile, 'r').read()) for name, video in reversed(DownloadLog): main.addDLog(name, video, 242, '', '', '', '', '', '') def LINK(mname, murl): ok = True if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I): infoLabels = main.GETMETAEpiT(mname, '', '') video_type = 'episode' season = infoLabels['season']
def LINKSP3(mname, murl): main.GA("Rls1Click", "Watched") msg = xbmcgui.DialogProgress() msg.create('Please Wait!', '') msg.update(0, 'Collecting hosts') link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('&', '&') sources = [] titles = [] urls = [] ok = True paragraphs = re.compile( '(?sim)<strong>1-Click</strong>.*?<strong>1GB Links</strong>').findall( link) for paragraph in paragraphs: urls = re.compile('href="(https?://[^<^\]^"]+)"').findall(paragraph) # match=re.compile('<a href="([^<]+)">htt').findall(link) # match = match1 + match print urls hostsmax = len(urls) h = 0 from urlparse import urlparse for url in urls: h += 1 percent = (h * 100) / hostsmax msg.update(percent, 'Collecting hosts - ' + str(percent) + '%') if msg.iscanceled(): break if '1fichier' in url: host = '1fichier' else: host = urlparse(url).hostname.replace('www.', '').partition('.')[0] hostname = host host = host.upper() if main.supportedHost(hostname): titles.append(host + ' [COLOR red]1080P[/COLOR]') sources.append(url) msg.close() if (len(sources) == 0): xbmc.executebuiltin( "XBMC.Notification(Sorry!,Could not find a playable link,3000)") return else: dialog = xbmcgui.Dialog() index = dialog.select('Choose your stream', titles) if index != -1: source = sources[index] else: source = None try: if not source: main.CloseAllDialogs() return xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,5000)") stream_url = main.resolve_url(source) if (stream_url == False): return if re.findall('(.+?)\ss(\d+)e(\d+)\s', mname, re.I): mname = mname.split('&')[0] infoLabels = main.GETMETAEpiT(mname, '', '') video_type = 'episode' season = infoLabels['season'] episode = infoLabels['episode'] else: infoLabels = main.GETMETAT(mname, '', '', '') 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']) } infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName'] } if not video_type is 'episode': infoL['originalTitle'] = main.removeColoredText( infoLabels['metaName']) # 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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory('plugin.video.movie25') wh.add_item(mname + ' ' + '[COLOR green]DL4Free[/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 LINKSAFLAM(mname, murl, thumb): main.GA("Aflam1", "Watched") if 'car-auto' not in murl: link = aflamOPENURL(murl) match = re.compile( '<a class="btn default large text-right" href="(.+?)"', re.DOTALL).findall(link) if match: murl = match[0] murl = murl.replace(' ', '') xbmc.executebuiltin("XBMC.Notification(Please Wait!,Resolving Link,5000)") print murl link = aflamOPENURL(murl) ok = True infoLabels = main.GETMETAT(mname, '', '', thumb) 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']) } match = re.compile("""<div id="Layer2".+?<iframe src='(.+?)'""", re.DOTALL).findall(link) if not match: match = re.compile('<div id="Layer2".+?<iframe src="(.+?)"', re.DOTALL).findall(link) if 'mail.ru' in match[0]: stream_url = get_mailru(match[0]) else: stream_url = main.resolve_url(match[0]) try: if stream_url == False: return infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'], 'originaltitle': infoLabels['metaName'] } # play with bookmark stream_url = stream_url.replace(' ', '%20') 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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(mname + ' ' + '[COLOR green]Aflam1[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_folder=False) player.KeepAlive() return True except Exception, e: if stream_url != False: main.ErrorReport(e) return False
import urllib, urllib2, re, cookielib, string, urlparse, sys, os import xbmc, xbmcgui, xbmcaddon, xbmcplugin, urlresolver from resources.libs import main #Mash Up - by Mash2k3 2012. from t0mm0.common.addon import Addon from resources.universal import playbackengine, watchhistory addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) addon = Addon('plugin.video.movie25', sys.argv) art = main.art wh = watchhistory.WatchHistory('plugin.video.movie25') def TSNDIR(): main.addDir( 'Featured', 'http://m.tsn.ca/home?p_p_id=feed_WAR_xlmagic_INSTANCE_C4iW&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=getPage&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=6&p_p_col_count=9&_feed_WAR_xlmagic_INSTANCE_C4iW_page=0&_feed_WAR_xlmagic_INSTANCE_C4iW_portrait=false', 97, art + '/tsn.png') main.addDir( 'NHL', 'http://m.tsn.ca/nhl?p_p_id=feed_WAR_xlmagic_INSTANCE_75Sw&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=getPage&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=2&p_p_col_count=3&_feed_WAR_xlmagic_INSTANCE_75Sw_page=0&_feed_WAR_xlmagic_INSTANCE_75Sw_portrait=false', 97, art + '/tsn.png') main.addDir( 'NFL', 'http://m.tsn.ca/nfl?p_p_id=feed_WAR_xlmagic_INSTANCE_u0tU&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=getPage&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=2&p_p_col_count=3&_feed_WAR_xlmagic_INSTANCE_u0tU_page=0&_feed_WAR_xlmagic_INSTANCE_u0tU_portrait=false', 97, art + '/tsn.png') #main.addDir('NBA','nba',97,art+'/tsn.png') main.addDir(
def VIDEOLINKSEXTRA(mname, murl, thumb, desc): main.GA("Watching Now", "Watched") xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Collecting hosts,5000)") sources = [] link = main.OPENURL(murl) ok = True infoLabels = main.GETMETAT(mname, '', '', thumb) 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']) } match = re.compile('<strong><a href="(.+?)" target=".+?">(.+?)</a>', re.DOTALL).findall(link) import urlresolver for url, host in match: link2 = getlink(murl, url) xurl = re.findall('var click_url = "(.+?)";', link2)[0] hosted_media = urlresolver.HostedMediaFile(url=xurl, title=host) sources.append(hosted_media) if (len(sources) == 0): xbmc.executebuiltin( "XBMC.Notification(Sorry!,Show doesn't have playable links,5000)") else: source = urlresolver.choose_source(sources) try: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = main.resolve_url(source.get_url()) if (stream_url == False): return infoL = { 'Title': infoLabels['title'], '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) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(mname + ' ' + '[COLOR green]Watching Now[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infolabels, img=img, fanart='', is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok