def SEARCHVIKI(): dialog = xbmcgui.Dialog() ret = dialog.select('[COLOR=FF67cc33][B]Choose A Search Type[/COLOR][/B]',['[B][COLOR=FF67cc33]TV Shows[/COLOR][/B]','[B][COLOR=FF67cc33]Movies[/COLOR][/B]']) if ret == -1: return if ret==0: keyb = xbmc.Keyboard('', 'Search For Shows') else: keyb = xbmc.Keyboard('', 'Search For Movies') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() encode=urllib.quote(search) if ret==0: surl='http://www.viki.com/search?q='+encode+'&type=series' else: surl='http://www.viki.com/search?q='+encode+'&type=film' html = main.OPENURL(surl) link=main.unescapes(html).decode('ascii', 'ignore') match = re.findall('(?sim)class="thumbnail pull-left"><img alt=".+?src="([^"]+)".+?<a href="([^"]+)">([^<]+)</a>.+?<p>(.+?)...',link.replace(' ','')) for thumb,url,name,desc in match: fan=re.findall('(.+?jpg)',thumb) if fan: fanart=fan[0] else: fanart='' if ret==0: main.addDirT(name,MainUrl+url,481,thumb,desc,fanart,'','','') else: main.addPlayc(name,url,482,thumb,desc,fanart,'','','')
def EPILIST(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') descs = re.compile( '<img src=".+?" width=".+?" height=".+?" alt=".+?" align=".+?" style=".+?"/>(.+?)</p>' ).findall(link) if len(descs) > 0: desc = descs[0] else: desc = '' thumbs = re.compile( '<img src="(.+?)" width=".+?" height=".+?" alt=".+?" align=".+?" style=".+?"/>' ).findall(link) if len(thumbs) > 0: thumb = thumbs[0] else: thumb = '' match = re.compile( '<li><a href="(.+?)" rel="bookmark" title=".+?">(.+?)</a></li>' ).findall(link) for url, name in match: main.addPlayc(name, url, 617, thumb, desc, '', '', '', '')
def MAIN(): xbmcgui.Window(10000).clearProperty('MASH_SSR_TYPE') d = settings.getHomeItems() for index, value in sorted(enumerate(d), key=lambda x:x[1]): if value==None: continue if index==0: main.addDirHome('Search',mainurl,420,art+'/search2.png') elif index==1: main.addDirHome("All Fav's",mainurl,639,art+'/favsu.png') elif index==2: main.addDirHome('A-Z',mainurl,6,art+'/az2.png') elif index==3: main.addDirHome('New Releases',mainurl + 'new-releases/',1,art+'/new2.png') elif index==4: main.addDirHome('Latest Added',mainurl + 'latest-added/',1,art+'/latest2.png') elif index==5: main.addDirHome('Featured Movies',mainurl + 'featured-movies/',1,art+'/feat2.png') elif index==6: main.addDirHome('Most Viewed',mainurl + 'most-viewed/',1,art+'/view2.png') elif index==7: main.addDirHome('Most Voted',mainurl + 'most-voted/',1,art+'/vote2.png') elif index==8: main.addDirHome('HD Releases',mainurl + 'latest-hd-movies/',1,art+'/dvd2hd.png') elif index==9: main.addDirHome('Genre',mainurl,2,art+'/genre2.png') elif index==10: main.addDirHome('By Year',mainurl,7,art+'/year2.png') elif index==11: main.addDirHome('Watch History','history',222,art+'/whistory.png') elif index==14: main.addDirHome('International','http://www.desirulez.net',36,art+'/intl.png') elif index==22: main.addDirHome('Kids Zone',mainurl,76,art+'/kidzone2.png') main.addPlayc('MashUp Settings',mainurl,1999,art+'/MashSettings.png','','','','','')
def subLink(mname,suburl): match=re.compile('<sublink>(.+?)</sublink>').findall(suburl) for url in match: match6=re.compile('http://(.+?)/.+?').findall(url) for url2 in match6: host = url2.replace('www.','').replace('.in','').replace('.net','').replace('.com','').replace('.to','').replace('.org','').replace('.ch','') main.addPlayc(mname+' [COLOR blue]'+host.upper()+'[/COLOR]',url,237,art+'/mainevent.png','','','','','')
def LIST3arabtv(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('»','').replace('→','') match=re.compile("""><img src="([^<]+)".+?<a href="([^<]+)">([^<]+)</a></span>""",re.DOTALL).findall(link) for thumb,url,name in match: thumb=thumb.split('"')[0] if 'http' not in thumb: thumb=MAINURL+thumb thumb=thumb.replace(' ','') if 'Episodes' in name or 'Shows' in name: name2=re.compile('href="'+url+'">'+name+'</a></span>.+?><a href=".+?">([^<]+)</a>',re.DOTALL).findall(link) if name2: name2=name2[0] else: name2='' main.addDir('[COLOR red]'+name+'[/COLOR] '+name2,MAINURL+url,356,thumb) else: if 'Clips' in name or 'Movies' in name: name2=re.compile('href="'+url+'">'+name+'</a></span>.+?><a href=".+?">([^<]+)</a>',re.DOTALL).findall(link) if name2: name2=name2[0] else: name2='' main.addPlayc('[COLOR red]'+name+'[/COLOR] '+name2,MAINURL+url,355,thumb,'','','','','') else: main.addPlayc(name,MAINURL+url,355,thumb,'','','','','') paginate = re.compile('''<a class="page" href="([^<]+)">Next''').findall(link) if len(paginate)>0: main.addDir('Next',MAINURL+paginate[0],353,art+'/next2.png') main.GA("3Arabtv","List")
def MAINSA(): setCookie('http://hostaccess.org/7-SFE-SZE-HOSTACCESS/') response = net().http_GET('http://hostaccess.org/7-SFE-SZE-HOSTACCESS/') link = response.content link = cleanHex(link) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace(' ', '') if '<title>Axxess Streams </title>' in link: main.addLink('[COLOR red]Elite Member[/COLOR]', '', '') else: main.addLink('[COLOR red]Free Member[/COLOR]', '', '') main.addDir( '[COLOR blue]Schedule[/COLOR]', 'http://www.sportsaccess.se/forum/calendar.php?action=weekview&calendar=1', 476, art + '/skyaccess.png') main.addDir('Free Streams', 'http://sportsaccess.se/forum/misc.php?page=livestreams', 412, art + '/skyaccess.png') if '<title>Axxess Streams </title>' in link: main.addDir('Elite Streams', link, 410, art + '/skyaccess.png') main.addPlayc( '[COLOR blue]Click here for Subscription Info[/COLOR]', 'https://dl.dropboxusercontent.com/u/35068738/picture%20for%20post/sky.png', 244, art + '/skyaccess.png', '', '', '', '', '') main.GA("Live", "SportsAccess")
def openFolder(name,folders): if selfAddon.getSetting("addmethod") == "false": main.addPlayc('Add Playlist',folders,250,art+'/xmlplaylistadd.png','','','','','') pl=0 fl=0 if os.path.exists(PlaylistFile): playlist=re.compile("{'name': '(.*?)', 'url': '(.*?)', 'fanart': '(.*?)', 'folder': '(.*?)', 'typeXml': '(.*?)', 'thumb': '(.*?)'}").findall(open(PlaylistFile,'r').read()) for name,url,fanart,folder,typeXml,thumb in sorted(playlist): if urllib.unquote_plus(folders)==urllib.unquote_plus(folder): name=urllib.unquote_plus(name) url=urllib.unquote_plus(url) thumb=urllib.unquote_plus(thumb) fanart=urllib.unquote_plus(fanart) if typeXml =='MashUp': main.addDirXml(name,url,239,thumb,folders,fanart,'','','') else: main.addDirXml(name,url,257,thumb,folders,fanart,typeXml,'','') pl=pl+1 if os.path.exists(FolderFile): foldered=re.compile("{'name': '(.*?)', 'fanart': '(.*?)', 'place': .+?, 'placeb': .+?, 'folder': '(.*?)', 'thumb': '(.*?)'}").findall(open(FolderFile,'r').read()) for name,fanart,folder,thumb in sorted(foldered): if urllib.unquote_plus(folders)==urllib.unquote_plus(folder): name=urllib.unquote_plus(name) thumb=urllib.unquote_plus(thumb) fanart=urllib.unquote_plus(fanart) main.addXmlFolder(name,folder+'-'+name,253,thumb,'',fanart,'','','') fl=fl+1 if fl==0 and pl==0 and selfAddon.getSetting("addmethod") == "true": main.addPlayc('Add Playlist',folders,250,art+'/xmlplaylistadd.png','','','','','')
def Mplaylists(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') r=re.findall('<poster>(.+?)</poster>',link) if r: vip=r[0] else: vip='Unknown' f=re.findall('<fanart>(.+?)</fanart>',link) if f: fan=f[0] else: fan=art+'/fanart2.jpg' match=re.compile('<name>(.+?)</name><link>(.+?)</link><thumbnail>(.+?)</thumbnail><date>(.+?)</date>').findall(link) for name,url,thumb,date in match: if '</vip>' in url: main.addDirc(name+' [COLOR red] '+date+'[/COLOR]',url,260,thumb,'',fan,'','','') else: main.addDirc(name+' [COLOR red] '+date+'[/COLOR]',url,236,thumb,'',fan,'','','') info=re.findall('<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>',link) if info: for msg,pic in info: main.addLink(msg,'',pic) popup=re.compile('<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>').findall(link) for name,image,thumb in popup: main.addPlayc(name,image,244,thumb,'',fan,'','','') main.GA("MoviePL",vip+"-Directory")
def SEARCHCINEM(): keyb = xbmc.Keyboard('', 'Search Movies') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() encode = urllib.quote(search) from t0mm0.common.net import Net as net url = 'http://cinemaxx.ru/' data = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Content-Length': '54', 'do': 'search', 'subaction': 'search', 'story': encode, 'x': '-1230', 'y': '-250' } link = net().http_POST(url, data).content match = re.compile( '<a href="([^<]+)" ><h1>(.+?)</h1>.+?<img align=".+?src="(.+?)".+?/>', re.DOTALL).findall(link) for url, name, thumb in match: try: name = name.encode('windows-1251') except: pass main.addPlayc(name, url, 364, thumb, '', '', '', '', '')
def LINK(manme, murl, thumb, fan, desc): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<a href="http://adf.ly/377117/(.+?)".+?target="_blank.+?>(.+?)</a>' ).findall(link) for url, name in match: name = name.replace('</b>', '').replace('<b>', '').replace( '<span style="font-size: x-large;">', '' ).replace( '<span id="goog_1857978069"></span><span id="goog_1857978070"></span>', '' ).replace( '<span style="font-family: Verdana, sans-serif; font-size: x-large;">', '' ).replace( '<span style="font-family: Verdana, sans-serif; font-size: large;">', '').replace('<span>', '').replace('</span>', '') http = re.compile('http://').findall(url) if len(http) == 0: url = 'http://' + url main.addPlayc(name, url, 622, thumb, desc, fan, '', '', '')
def MAINMENU(): main.addDir("Search", BASE_URL + "?s=", 1024, art + "/tpsearch.png") main.addDir("TV Shows", BASE_URL, 1021, art + "/tptvshows.png") main.addDir("Movies", BASE_URL, 1022, art + "/tpmovies.png") # main.addDir('TubePLUS Movie Charts','http://www.tubeplus.me/tool/',1023,'') main.addPlayc("Resolver Settings", BASE_URL, 1004, art + "/tpsettings.png", "", "", "", "", "") main.VIEWSB()
def LISTVIKIM(murl): html = main.OPENURL(murl) link=main.unescapes(html).decode('ascii', 'ignore') match = re.findall('(?sim)class="thumbnail pull-left"><img alt=".+?src="([^"]+)".+?<a href="([^"]+)">([^<]+)</a>.+?<p>(.+?)...',link.replace(' ','')) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Movie list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].' dialogWait.update(0,'[B]Will load instantly from now on[/B]',remaining_display) for thumb,url,name,desc in match: fan=re.findall('(.+?jpg)',thumb) if fan: fanart=fan[0] else: fanart='' main.addPlayc(name,url,482,thumb,desc,fanart,'','','') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100)/totalLinks remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].' dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display) if (dialogWait.iscanceled()): return False dialogWait.close() del dialogWait paginate = re.compile("(?sim)<a class='page-link' rel='next' href='([^']+)'>Next →</a>").findall(link) if len(paginate)>0: main.addDir('[COLOR blue]Next Page >>>[/COLOR]',MainUrl+paginate[0],483,art+'/next2.png') main.GA("Viki","List")
def Mplaylists(murl): link = main.OPENURL(murl) link = link.replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", "") r = re.findall("<poster>(.+?)</poster>", link) if r: vip = r[0] else: vip = "Unknown" f = re.findall("<fanart>(.+?)</fanart>", link) if f: fan = f[0] else: fan = art + "/fanart2.jpg" match = re.compile("<name>(.+?)</name><link>(.+?)</link><thumbnail>(.+?)</thumbnail><date>(.+?)</date>").findall( link ) for name, url, thumb, date in match: if "</vip>" in url: main.addDirc(name + " [COLOR red] " + date + "[/COLOR]", url, 260, thumb, "", fan, "", "", "") else: main.addDirc(name + " [COLOR red] " + date + "[/COLOR]", url, 236, thumb, "", fan, "", "", "") info = re.findall("<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>", link) if info: for msg, pic in info: main.addLink(msg, "", pic) popup = re.compile( "<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>" ).findall(link) for name, image, thumb in popup: main.addPlayc(name, image, 244, thumb, "", fan, "", "", "") main.GA("MoviePL", vip + "-Directory")
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 MAINMENU(): main.addDir('Search', BASE_URL+'?s=',1024,art+'/tpsearch.png') main.addDir('TV Shows',BASE_URL,1021,art+'/tptvshows.png') main.addDir('Movies',BASE_URL,1022,art+'/tpmovies.png') #main.addDir('TubePLUS Movie Charts','http://www.tubeplus.me/tool/',1023,'') main.addPlayc('Resolver Settings',BASE_URL,1004,art+'/tpsettings.png','','','','','') main.VIEWSB()
def VIPplaylists(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') r = re.findall('<poster>(.+?)</poster>', link) if r: vip = r[0] else: vip = 'Unknown' f = re.findall('<fanart>(.+?)</fanart>', link) if f: fan = f[0] else: fan = art + '/fanart2.jpg' match = re.compile( '<name>(.+?)</name><link>(.+?)</link><thumbnail>(.+?)</thumbnail><date>(.+?)</date>' ).findall(link) for name, url, thumb, date in match: main.addDirc(name + ' [COLOR red] Updated ' + date + '[/COLOR]', url, 182, thumb, '', fan, '', '', '') info = re.findall( '<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>', link) if info: for msg, pic in info: main.addLink(msg, '', pic) popup = re.compile( '<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>' ).findall(link) for name, image, thumb in popup: main.addPlayc(name, image, 244, thumb, '', '', '', '', '') main.GA("Live", vip + "-Playlists")
def VIPList(mname,murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') r=re.findall('<poster>(.+?)</poster>',link) if r: vip=r[0] else: vip='Unknown' f=re.findall('<fanart>(.+?)</fanart>',link) if f: fan=f[0] else: fan=art+'/fanart2.jpg' info=re.findall('<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>',link) if info: for msg,pic in info: main.addLink(msg,'',pic) popup=re.compile('<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>').findall(link) for name,image,thumb in popup: main.addPlayc(name,image,244,thumb,'','','','','') directory=re.compile('<dir><name>([^<]+)</name.+?link>([^<]+)</link.+?thumbnail>([^<]+)</thumbnail></dir>').findall(link) for name,url,thumb in directory: main.addDir(name,url,182,thumb) match=re.compile('<title>([^<]+)</title.+?link>(.+?)</link.+?thumbnail>([^<]+)</thumbnail>').findall(link) for name,url,thumb in sorted(match): main.addPlayL(name+' [COLOR blue]'+vip+'[/COLOR]',url,183,thumb,'',fan,'','','',secName=vip,secIcon=art+'/'+vip.lower()+'.png') main.GA(vip+"-Playlists",mname)
def MList(mname, murl): mname = mname.split('[C')[0] link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') r = re.findall('<poster>(.+?)</poster>', link) if r: vip = r[0] else: vip = 'Unknown' f = re.findall('<fanart>(.+?)</fanart>', link) if f: fan = f[0] else: fan = art + '/fanart2.jpg' info = re.findall( '<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>', link) if info: for msg, pic in info: main.addLink(msg, '', pic) popup = re.compile( '<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>' ).findall(link) for name, image, thumb in popup: main.addPlayc(name, image, 244, thumb, '', '', '', '', '') directory = re.compile( '<dir><name>([^<]+)</name.+?link>([^<]+)</link.+?thumbnail>([^<]+)</thumbnail></dir>' ).findall(link) for name, url, thumb in directory: main.addDir(name, url, 246, thumb) match = re.compile( '<subchannel><name>(.+?)</name.+?fanart>(.+?)</fanart.+?thumbnail>(.+?)</thumbnail.+?link>(.+?)</link></subchannel>' ).findall(link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Movie list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Movies loaded :: [B]' + str( loadedLinks) + ' / ' + str(totalLinks) + '[/B].' dialogWait.update(0, '[B]Will load instantly from now on[/B]', remaining_display) for name, fan, thumb, url in match: main.addDown4(name + ' [COLOR blue]' + vip + '[/COLOR]', url, 247, thumb, '', fan, '', '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = 'Movies loaded :: [B]' + str( loadedLinks) + ' / ' + str(totalLinks) + '[/B].' dialogWait.update(percent, '[B]Will load instantly from now on[/B]', remaining_display) if (dialogWait.iscanceled()): return False dialogWait.close() del dialogWait main.GA(vip + "-Directory", vip + "-Playlist")
def LISTEPI(mname, murl, thumb): link = aflamOPENURL(murl) link = link.replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", "").replace("»", "") match = re.compile( """<li>([^<]+)<span dir="ltr"><a href="([^"]+)" onClick=".+?">([^<]+)</a></span>""", re.DOTALL ).findall(link) for num, url, name in match: main.addPlayc(num + " " + name, url, 338, thumb, "", "", "", "", "")
def GLOBALBCList(murl): #main.GA("GlobalBC","List") link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match=re.compile('<a class=".+?" href="([^<]+)" title="([^<]+)" data-vid_id=".+?"><img src="http://en.wordpress.com/imgpress.?url=([^<]+)w=300" alt=".+?"><div><h4>([^<]+)</h4>').findall(link) for url, name,thumb,cat in match: thumb=thumb.replace('jpg&','jpg') main.addPlayc('[COLOR red]'+cat+':[/COLOR] '+name,thumb,167,thumb,'','','','','')
def LISTEPI(mname, murl, thumb): link = main.OPENURL(murl) link = link.replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", "").replace("»", "") match = re.compile( """<h3><a class="play" href="([^<]+)" onClick="return popups.+?">(.+?)</a></h3>""", re.DOTALL ).findall(link) for url, name in match: main.addPlayc(name, url, 338, thumb, "", "", "", "", "")
def LIST3arabtvEPI(murl, thumb): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('»', '').replace('→', '') match = re.compile("""<h5><a href="([^<]+)">([^<]+)</a></h5>""", re.DOTALL).findall(link) for url, name in match: main.addPlayc(name, MAINURL + url, 355, thumb, '', '', '', '', '')
def MAINMAILRU(murl): main.addDir('Search(поиск)','aflam',359,art+'/search.png') link=geturl(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('»','').replace('\\','') match=re.compile("""style="background-image: url.?'(.+?)'.+?"data-videourl="(.+?)"data-clns=".+?"></span><span class=".+?">(.+?)</span><span class=".+?"><span class=".+?"></span>(.+?)</span>""",re.DOTALL).findall(link) for thumb,url,dur,name in match: name=name.encode('windows-1251') main.addPlayc(name,MAINURL+url+'.html',358,thumb,'','','','','') main.GA("Plugin","MailRu")
def MAINMAILRU(murl): main.addDir('Search(поиск)','aflam',359,art+'/search.png') link=geturl(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('»','').replace('\\','') match=re.compile("""class="b-catalog__video-item-time font-small">([^<]+)</span><span.+?title="([^"]+)"><a type="videolayer"href="http://my.mail.ru/mail/(.+?)"data-clns=.+?style="background-image: url\('([^']+)'\);">""",re.DOTALL).findall(link) for dur,name,url,thumb in match: name=name.encode('windows-1251') url=url.replace('/video','') main.addPlayc(name,MAINURL+url,358,thumb,'','','','','')
def LISTEPI(mname, murl, thumb): link = aflamOPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('»', '') match = re.compile( """<li>([^<]+)<span dir="ltr"><a href="([^"]+)" onClick=".+?">([^<]+)</a></span>""", re.DOTALL).findall(link) for num, url, name in match: main.addPlayc(num + ' ' + name, url, 338, thumb, '', '', '', '', '')
def LISTCINEM(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('»','') match=re.compile('style="float:left;"><div><a href="(.+?)"><img src="(.+?)" alt="(.+?)".+?<div id=".+?" style=".+?">(.+?)</div>',re.DOTALL).findall(link) for url,thumb,name,desc in match: main.addPlayc(name,url,364,thumb,desc,'','','','') paginate = re.compile('''<a href="([^<]+)"><strong>.+?span''').findall(link) if len(paginate)>0: main.addDir('Next',paginate[0],363,art+'/next2.png')
def MList(mname,murl): mname = mname.split('[C')[0] link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') r=re.findall('<poster>(.+?)</poster>',link) if r: vip=r[0] else: vip='Unknown' f=re.findall('<fanart>(.+?)</fanart>',link) if f: fan=f[0] else: fan=art+'/fanart2.jpg' info=re.findall('<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>',link) if info: for msg,pic in info: main.addLink(msg,'',pic) popup=re.compile('<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>').findall(link) for name,image,thumb in popup: main.addPlayc(name,image,244,thumb,'',fan,'','','') directory=re.compile('<dir><name>([^<]+)</name.+?link>([^<]+)</link.+?thumbnail>([^<]+)</thumbnail></dir>').findall(link) for name,url,thumb in directory: main.addDirb(name,url,236,thumb,fan) match=re.compile('<title>([^<]+)</title.+?link>(.+?)</link.+?thumbnail>([^<]+)</thumbnail>').findall(link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Movie list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].' dialogWait.update(0,'[B]Will load instantly from now on[/B]',remaining_display) xbmc.executebuiltin("XBMC.Dialog.Close(busydialog,true)") for name,url,thumb in match: if '</sublink>' in url: main.addDown4(name+' [COLOR blue]'+vip+'[/COLOR]',url,249,thumb,'',fan,'','','') elif '</referer>' in url: main.addDown4(name+' [COLOR blue]'+vip+'[/COLOR]',url,259,thumb,'',fan,'','','') elif '</dirlist>' in url: xurl = re.findall('<dirlist>(.+?)</dirlist>', url)[0] main.addDirb(name,xurl,236,thumb,fan) elif '</noMeta>' in url: xurl = re.findall('<noMeta>(.+?)</noMeta>', url)[0] main.addPlayc(name+' [COLOR blue]'+vip+'[/COLOR]',xurl,237,thumb,'',fan,'','','') else: main.addDown4(name+' [COLOR blue]'+vip+'[/COLOR]',url,237,thumb,'',fan,'','','') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100)/totalLinks remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].' dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display) if (dialogWait.iscanceled()): return False dialogWait.close() del dialogWait main.GA(vip+"-Directory",vip+"-Playlist")
def LISTFM(mname,murl): main.GA("181fm","List") if xbmc.Player().isPlayingAudio(): main.addPlayc('[COLOR red]Download Current Track Playing[/COLOR]','dummy', 213 ,art+"hubmusic.png",'','','','','') main.addPlayc('[COLOR red]Search Current Artist Playing[/COLOR]','dummy', 214,art+"hubmusic2.png",'','','','','') thumb=art+"%s.png"%(mname) print "kk "+thumb match = re.compile('<a STYLE="text-decoration:none" href="(.+?)" class="left_link">(.+?)</a></font></td>').findall(murl) for url,name in match: main.addPlayL(name,url,193,thumb,'','','','','')
def MAINPFTV(index=False): main.addDir('Search','s',468,art+'/search.png',index=index) main.addDir('A-Z','s',463,art+'/az.png',index=index) main.addDir('Yesterdays Episodes',BASE_URL+'index_last_3_days.html',460,art+'/yesepi.png',index=index) main.addDir('Todays Episodes',BASE_URL+'index_last.html',460,art+'/toepi2.png',index=index) main.addDir('Popular Shows','shows',467,art+'/popshowsws.png',index=index) main.addDir('This Weeks Popular Episodes','season',467,art+'/thisweek.png',index=index) if selfAddon.getSetting("tube-proxy") == "true": main.addPlayc('Proxy [COLOR green]ON[/COLOR]',BASE_URL,1004,art+'/pftv.png','','','','','') else: main.addPlayc('Proxy [COLOR red]OFF[/COLOR]',BASE_URL,1004,art+'/pftv.png','','','','','') main.VIEWSB()
def MAINMENU(): main.addDir('Search', BASE_URL+'?s=',1024,art+'/tpsearch.png') main.addDir('TV Shows',BASE_URL,1021,art+'/tptvshows.png') main.addDir('Movies',BASE_URL,1022,art+'/tpmovies.png') #main.addDir('TubePLUS Movie Charts','http://www.tubeplus.me/tool/',1023,'') if selfAddon.getSetting("tube-proxy") == "true": main.addPlayc('Proxy [COLOR green]ON[/COLOR]',BASE_URL,1004,art+'/tpsettings.png','','','','','') else: main.addPlayc('Proxy [COLOR red]OFF[/COLOR]',BASE_URL,1004,art+'/tpsettings.png','','','','','') main.VIEWSB()
def LISTFM(mname,murl): main.GA("181fm","List") if xbmc.Player().isPlayingAudio(): main.addPlayc('[COLOR red]Download Current Track Playing[/COLOR]','dummy', 213 ,art+"hubmusic.png",'','','','','') main.addPlayc('[COLOR red]Search Current Artist Playing[/COLOR]','dummy', 214,art+"hubmusic2.png",'','','','','') image=mname.replace(' ','%20') thumb=art+'/'+"%s.png"%(image) match = re.compile('<a STYLE="text-decoration:none" href="(.+?)" class="left_link">(.+?)</a></font></td>').findall(murl) for url,name in match: main.addPlayL(name,url,193,thumb,'','','','','')
def MList(mname, murl): mname = mname.split("[C")[0] link = main.OPENURL(murl) link = link.replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", "") r = re.findall("<poster>(.+?)</poster>", link) if r: vip = r[0] else: vip = "Unknown" f = re.findall("<fanart>(.+?)</fanart>", link) if f: fan = f[0] else: fan = art + "/fanart2.jpg" info = re.findall("<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>", link) if info: for msg, pic in info: main.addLink(msg, "", pic) popup = re.compile( "<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>" ).findall(link) for name, image, thumb in popup: main.addPlayc(name, image, 244, thumb, "", fan, "", "", "") directory = re.compile( "<dir><name>([^<]+)</name.+?link>([^<]+)</link.+?thumbnail>([^<]+)</thumbnail></dir>" ).findall(link) for name, url, thumb in directory: main.addDirb(name, url, 236, thumb, fan) match = re.compile("<title>([^<]+)</title.+?link>(.+?)</link.+?thumbnail>([^<]+)</thumbnail>").findall(link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create("Please wait until Movie list is cached.") totalLinks = len(match) loadedLinks = 0 remaining_display = "Movies loaded :: [B]" + str(loadedLinks) + " / " + str(totalLinks) + "[/B]." dialogWait.update(0, "[B]Will load instantly from now on[/B]", remaining_display) for name, url, thumb in match: if "</sublink>" in url: main.addDown4(name + " [COLOR blue]" + vip + "[/COLOR]", url, 249, thumb, "", fan, "", "", "") elif "</referer>" in url: main.addDown4(name + " [COLOR blue]" + vip + "[/COLOR]", url, 259, thumb, "", fan, "", "", "") else: main.addDown4(name + " [COLOR blue]" + vip + "[/COLOR]", url, 237, thumb, "", fan, "", "", "") loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = "Movies loaded :: [B]" + str(loadedLinks) + " / " + str(totalLinks) + "[/B]." dialogWait.update(percent, "[B]Will load instantly from now on[/B]", remaining_display) if dialogWait.iscanceled(): return False dialogWait.close() del dialogWait main.GA(vip + "-Directory", vip + "-Playlist")
def LINK(manme,murl,thumb,fan,desc): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match= re.compile('<a href="http://adf.ly/377117/(.+?)".+?target="_blank.+?>(.+?)</a>').findall(link) for url,name in match: name=name.replace('</b>','').replace('<b>','').replace('<span style="font-size: x-large;">','').replace('<span id="goog_1857978069"></span><span id="goog_1857978070"></span>','').replace('<span style="font-family: Verdana, sans-serif; font-size: x-large;">','').replace('<span style="font-family: Verdana, sans-serif; font-size: large;">','').replace('<span>','').replace('</span>','') http= re.compile('http://').findall(url) if len(http)==0: url='http://'+url main.addPlayc(name,url,622,thumb,desc,fan,'','','')
def NFLMAIN(): link = main.OPENURL( 'http://www.nfl.com/feeds-rs/videos/byChannel/nfl-videos.json') link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall( '(?sim)"headline":"([^"]+)".+?"mediumImageUrl":"([^"]+)".+?"videoPath":"([^"]+)","bitrate":3000000', link) for name, thumb, url in match: main.addPlayc(name, url, 183, thumb, '', '', '', '', '')
def MAINFM(): main.GA("Live","181fm") if xbmc.Player().isPlayingAudio(): main.addPlayc('[COLOR red]Download Current Track Playing[/COLOR]','dummy', 213 ,art+"hubmusic.png",'','','','','') main.addPlayc('[COLOR red]Search Current Artist Playing[/COLOR]','dummy', 214,art+"hubmusic2.png",'','','','','') link=main.OPENURL('http://www.181.fm/channellistmini.php') link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match = re.compile('700"><br>(.+?)</font></td>(.+?)</table>').findall(link) for name,url in match: name=name.replace('/','&') main.addDir(name,url,192,art+name+".png")
def GLOBALBCSearch(): keyb = xbmc.Keyboard('', 'Search Global BC') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() encode=urllib.quote(search) surl='http://globalnews.ca/national/videos/?video-search='+encode link=main.OPENURL(surl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match=re.compile('<a class=".+?" href="([^<]+)" title="([^<]+)"><img src="http://en.wordpress.com/imgpress.?url=([^<]+)w=300" alt=".+?"><div><h4>([^<]+)</h4>').findall(link) for url, name,thumb,cat in match: main.addPlayc('[COLOR red]'+cat+':[/COLOR] '+name,thumb,167,thumb,'','','','','')
def LIST3arabtvEPI(murl, thumb): link = main.OPENURL(murl) link = ( link.replace("\r", "") .replace("\n", "") .replace("\t", "") .replace(" ", "") .replace("»", "") .replace("→", "") ) match = re.compile("""<h5><a href="([^<]+)">([^<]+)</a></h5>""", re.DOTALL).findall(link) for url, name in match: main.addPlayc(name, MAINURL + url, 355, thumb, "", "", "", "", "")
def MAINPFTV(index=False): main.addDir('Search','s',468,art+'/search.png',index=index) main.addDir('A-Z','s',463,art+'/az.png',index=index) main.addDir('Yesterdays Episodes',BASE_URL+'index_last_3_days.html',460,art+'/yesepi.png',index=index) main.addDir('Todays Episodes',BASE_URL+'index_last.html',460,art+'/toepi2.png',index=index) main.addDir('Popular Shows','shows',467,art+'/popshowsws.png',index=index) main.addDir('This Weeks Popular Episodes','season',467,art+'/thisweek.png',index=index) if selfAddon.getSetting("tube-proxy") == "true": main.addPlayc('Proxy [COLOR green]ON[/COLOR]',BASE_URL,1004,art+'/pftv.png','','','','','') else: main.addPlayc('Proxy [COLOR red]OFF[/COLOR]',BASE_URL,1004,art+'/pftv.png','','','','','') main.GA("Plugin",prettyName) main.VIEWSB()
def MAINPFTV(index=False): main.addDir("Search", "s", 468, art + "/search.png", index=index) main.addDir("A-Z", "s", 463, art + "/az.png", index=index) main.addDir("Yesterdays Episodes", BASE_URL + "index_last_3_days.html", 460, art + "/yesepi.png", index=index) main.addDir("Todays Episodes", BASE_URL + "index_last.html", 460, art + "/toepi2.png", index=index) main.addDir("Popular Shows", "shows", 467, art + "/popshowsws.png", index=index) main.addDir("This Weeks Popular Episodes", "season", 467, art + "/thisweek.png", index=index) if selfAddon.getSetting("tube-proxy") == "true": main.addPlayc("Proxy [COLOR green]ON[/COLOR]", BASE_URL, 1004, art + "/pftv.png", "", "", "", "", "") else: main.addPlayc("Proxy [COLOR red]OFF[/COLOR]", BASE_URL, 1004, art + "/pftv.png", "", "", "", "", "") main.GA("Plugin", prettyName) main.VIEWSB()
def MAINMAILRU(murl): main.addDir('Search(поиск)', 'aflam', 359, art + '/search.png') link = geturl(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('»', '').replace('\\', '') match = re.compile( """class="b-catalog__video-item-time font-small">([^<]+)</span><span.+?title="([^"]+)"><a type="videolayer"href="http://my.mail.ru/mail/(.+?)"data-clns=.+?style="background-image: url\('([^']+)'\);">""", re.DOTALL).findall(link) for dur, name, url, thumb in match: name = name.encode('windows-1251') url = url.replace('/video', '') main.addPlayc(name, MAINURL + url, 358, thumb, '', '', '', '', '') main.GA("Plugin", "MailRu")
def LISTCINEM(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('»', '') match = re.compile( 'style="float:left;"><div><a href="(.+?)"><img src="(.+?)" alt="(.+?)".+?<div id=".+?" style=".+?">(.+?)</div>', re.DOTALL).findall(link) for url, thumb, name, desc in match: main.addPlayc(name, url, 364, thumb, desc, '', '', '', '') paginate = re.compile('''<a href="([^<]+)"><strong>.+?span''').findall( link) if len(paginate) > 0: main.addDir('Next', paginate[0], 363, art + '/next2.png')
def MAINFM(): main.GA("Live","181fm") if xbmc.Player().isPlayingAudio(): main.addPlayc('[COLOR red]Download Current Track Playing[/COLOR]','dummy', 213 ,art+"hubmusic.png",'','','','','') main.addPlayc('[COLOR red]Search Current Artist Playing[/COLOR]','dummy', 214,art+"hubmusic2.png",'','','','','') link=main.OPENURL('http://www.181.fm/channellistmini.php') link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match = re.compile('700"><br>(.+?)</font></td>(.+?)</table>').findall(link) for name,url in match: name=name.replace('/','&') thumb=name.replace(' ','%20') main.addDir(name,url,192,art+'/'+thumb+".png")
def GLOBALBCList(murl): main.GA("GlobalBC", "List") link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<a class=".+?" href="([^<]+)" title="([^<]+)" data-vid_id=".+?"><img src="http://en.wordpress.com/imgpress.?url=([^<]+)w=300" alt=".+?"><div><h4>([^<]+)</h4>' ).findall(link) for url, name, thumb, cat in match: thumb = thumb.replace('jpg&', 'jpg') main.addPlayc('[COLOR red]' + cat + ':[/COLOR] ' + name, thumb, 167, thumb, '', '', '', '', '')
def MAINSA(): setCookie('http://hostaccess.org/7-SFE-SZE-HOSTACCESS/') response = net().http_GET('http://hostaccess.org/7-SFE-SZE-HOSTACCESS/') link = response.content link = cleanHex(link) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','') if '<title>Axxess Menu</title>' in link: main.addLink('[COLOR red]Elite Member[/COLOR]','','') else: main.addLink('[COLOR red]Free Member[/COLOR]','','') main.addDir('Free Streams','http://sportsaccess.se/forum/misc.php?page=livestreams',412,art+'/skyaccess.png') if '<title>Axxess Menu</title>' in link: main.addDir('Elite Streams',link,410,art+'/skyaccess.png') main.addPlayc('[COLOR blue]Click here for Subscription Info[/COLOR]','https://dl.dropboxusercontent.com/u/35068738/picture%20for%20post/sky.png',244,art+'/skyaccess.png','','','','','')
def VIPplaylists(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') r=re.findall('<bdposter>(.+?)</bdposter>',link) if r: vip=r[0] else: vip='BDTV' f=re.findall('<fanart>(.+?)</fanart>',link) if f: fan=f[0] else: fan=art+'/fanart2.jpg' match=re.compile('<notify><new>(.+?)</new><mess1>(.+?)</mess1><mess2>(.+?)</mess2><mess3>(.+?)</mess3><old>(.+?)</old></notify>').findall(link) if len(match)>0: for new,mes1,mes2,mes3,old in match: continue if new != ' ': new=vip+new runonce=os.path.join(main.datapath,'RunOnce') notified=os.path.join(runonce,str(new)) if not os.path.exists(notified): open(notified,'w').write('version="%s",'%new) dialog = xbmcgui.Dialog() ok=dialog.ok('[B]'+vip+' Announcement![/B]', str(mes1) ,str(mes2),str(mes3)) if old != ' ': old=vip+old notified=os.path.join(runonce,str(old)) if os.path.exists(notified): os.remove(notified) else: print 'No Messages' else: print 'Github Link Down' match3=re.compile('<name>([^<]+)</name><link>([^<]+)</link><thumbnail>([^<]+)</thumbnail><mode>([^<]+)</mode>').findall(link) for name,url,thumb,mode in match3: if re.findall('http',thumb): thumbs=thumb else: thumbs=art+'/'+thumb+'.png' main.addDir(name,url,int(mode),thumbs) match=re.compile('<name>([^<]+)</name><link>([^<]+)</link><thumbnail>([^<]+)</thumbnail><date>([^<]+)</date>').findall(link) for name,url,thumb,date in match: main.addDirc(name+' [COLOR red] Updated '+date+'[/COLOR]',url,182,thumb,'',fan,'','','') info=re.findall('<info><mess>(.+?)</mess><thumbnail>(.+?)</thumbnail></info>',link) if info: for msg,pic in info: main.addLink(msg,'',pic) popup=re.compile('<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>').findall(link) for name,image,thumb in popup: main.addPlayc(name,image,244,thumb,'','','','','') main.GA("Live",vip+"-Playlists")
def TRACKEDSHOWS(): main.GA("SideReel", "Tracked Shows") from t0mm0.common.net import Net as net setCookie(MAINURL) cookie = main.getFile(cookie_file) user = re.findall('SrLoggedIn=(.+?);', cookie) if user: user = user[0] method = re.findall('SrLoginMethod=(.+?);', cookie)[0] token = re.findall('remember_user_token="(.+?)";', cookie)[0] session = re.findall('sidereel_session=(.+?);', cookie)[0] header = { 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'en-US,en;q=0.8', 'Cache-Control': 'max-age=0', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Cookie': 'SrLoggedIn=' + user + '; SrLoginMethod=' + method + '; remember_user_token=' + token + '; _sidereel_session=' + session + ';', 'Referer': MAINURL, 'X-Requested-With': 'XMLHttpRequest' } #post_data={'authenticity_token':auth,'tv_show_id':showID} data = net().http_GET('http://www.sidereel.com/users/tracked_tv_shows', header).content data = data.encode("utf8", "ignore") match = re.compile( '"tv_show":{"id":(.+?),"name":"(.+?)",.+?,"status":(.+?),"summary":(.+?),"network":(.+?),.+?,"cached_genre_list":(.+?),.+?,"canonical_url":"(.+?)",.+?,"image_url_medium":"(.+?)",', re.DOTALL).findall(data) for id, name, status, plot, network, genre, url, thumb in match: main.addPlayc( name + ' [COLOR blue]' + network.replace('"', '').replace('null', '') + '[/COLOR] [COLOR red]' + status.replace('"', '').replace('null', '') + '[/COLOR]', '<id>' + id + '<xo>' + url + '</xo>', 400, thumb, plot.replace('"', '').replace('null', ''), '', '', genre.replace('"', '').replace('null', ''), '')
def MAIN(): folders = 'home' pl = 0 fl = 0 if selfAddon.getSetting("hideinstruction") == "false": main.addPlayc('My XML Channel Instructions', 'nills', 248, art + '/xml.png', '', '', '', '', '') if selfAddon.getSetting("addmethod") == "false": main.addPlayc('Add Playlist', folders, 250, art + '/xmlplaylistadd.png', '', '', '', '', '') main.addPlayc('Add Folder', folders, 252, art + '/folderadd.png', '', '', '', '', '') if os.path.exists(PlaylistFile): playlist = re.compile( "{'name': '(.*?)', 'url': '(.*?)', 'fanart': '(.*?)', 'folder': '(.*?)', 'typeXml': '(.*?)', 'thumb': '(.*?)'}" ).findall(open(PlaylistFile, 'r').read()) for name, url, fanart, folder, typeXml, thumb in sorted(playlist): if urllib.unquote_plus(folders) == urllib.unquote_plus(folder): name = urllib.unquote_plus(name) url = urllib.unquote_plus(url) thumb = urllib.unquote_plus(thumb) fanart = urllib.unquote_plus(fanart) if typeXml == 'MashUp': main.addDirXml(name, url, 239, thumb, folders, fanart, '', '', '') else: main.addDirXml(name, url, 257, thumb, folders, fanart, typeXml, '', '') pl = pl + 1 if os.path.exists(FolderFile): foldered = re.compile( "{'name': '(.*?)', 'fanart': '(.*?)', 'place': .+?, 'placeb': .+?, 'folder': '(.*?)', 'thumb': '(.*?)'}" ).findall(open(FolderFile, 'r').read()) for name, fanart, folder, thumb in sorted(foldered): if urllib.unquote_plus(folders) == urllib.unquote_plus(folder): name = urllib.unquote_plus(name) folder = urllib.unquote_plus(folder) thumb = urllib.unquote_plus(thumb) fanart = urllib.unquote_plus(fanart) main.addXmlFolder(name, folder + '-' + name, 253, thumb, folder, fanart, '', '', '') fl = fl + 1 if fl == 0 and pl == 0 and selfAddon.getSetting("addmethod") == "true": main.addPlayc('Add Playlist', folders, 250, art + '/xmlplaylistadd.png', '', '', '', '', '') main.addPlayc('Add Folder', folders, 252, art + '/folderadd.png', '', '', '', '', '')
def VIPList(mname, murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') r = re.findall('<poster>(.+?)</poster>', link) if r: vip = r[0] else: vip = 'Unknown' f = re.findall('<fanart>(.+?)</fanart>', link) if f: fan = f[0] else: fan = art + '/fanart2.jpg' info = re.findall( '<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>', link) if info: for msg, pic in info: main.addLink(msg, '', pic) popup = re.compile( '<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>' ).findall(link) for name, image, thumb in popup: main.addPlayc(name, image, 244, thumb, '', '', '', '', '') directory = re.compile( '<dir><name>([^<]+)</name.+?link>([^<]+)</link.+?thumbnail>([^<]+)</thumbnail></dir>' ).findall(link) for name, url, thumb in directory: main.addDir(name, url, 182, thumb) match = re.compile( '<title>([^<]+)</title.+?link>(.+?)</link.+?thumbnail>([^<]+)</thumbnail>' ).findall(link) for name, url, thumb in sorted(match): main.addPlayL(name + ' [COLOR blue]' + vip + '[/COLOR]', url, 183, thumb, '', fan, '', '', '', secName=vip, secIcon=art + '/' + vip.lower() + '.png') main.GA(vip + "-Playlists", mname)
def SEARCHMovie1k(murl): seapath = os.path.join(main.datapath, 'Search') SeaFile = os.path.join(seapath, 'SearchHistoryTv') try: os.makedirs(seapath) except: pass if murl == 'M1k': keyb = xbmc.Keyboard('', 'Search For Shows or Movies') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() encode = urllib.quote(search) surl = 'http://www.movie1k.ws/?s=' + encode if not os.path.exists(SeaFile) and encode != '': open(SeaFile, 'w').write('search="%s",' % encode) else: if encode != '': open(SeaFile, 'a').write('search="%s",' % encode) searchis = re.compile('search="(.+?)",').findall( open(SeaFile, 'r').read()) for seahis in reversed(searchis): continue if len(searchis) >= 10: searchis.remove(searchis[0]) os.remove(SeaFile) for seahis in searchis: try: open(SeaFile, 'a').write('search="%s",' % seahis) except: pass else: encode = murl surl = 'http://www.movie1k.ws/?s=' + encode link = main.OPENURL(surl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<a class="entry-thumbnails-link" href="(.+?)"><img width=".+?" height=".+?" src="(.+?)" class=".+?" alt="Watch (.+?) Online:.+?', re.DOTALL).findall(link) for url, thumb, name in match: main.addPlayc(name, url, 31, thumb, '', '', '', '', '') main.GA("Movie1k", "Search")
def MAIN(): main.addPlayc('My XML Channel Instructions', 'nills', 248, art + '/xml.png', '', '', '', '', '') if os.path.exists(xmlPath): xmlfolder = os.path.join(xmlPath, 'MyXmlChannels') try: os.makedirs(xmlfolder) xbmc.executebuiltin( "XBMC.Notification(Attention!,MyXmlChannel Folder Created,5000," ")") except: pass for path, subdirs, files in os.walk(xmlfolder): for filename in files: if re.findall('.xml', filename): name = filename.replace('.xml', '') url = xmlfolder + '/' + filename thumbfile = os.path.join(xmlfolder, name + '.png') if not os.path.exists(thumbfile): thumbfile = os.path.join(xmlfolder, name + '.jpg') fanfile = os.path.join(xmlfolder, name + 'Fanart.png') if not os.path.exists(fanfile): fanfile = os.path.join(xmlfolder, name + 'Fanart.jpg') if os.path.exists(thumbfile): if 'png' in thumbfile: thumb = xmlfolder + '/' + name + '.png' else: thumb = xmlfolder + '/' + name + '.jpg' else: thumb = '' if os.path.exists(fanfile): if 'png' in fanfile: fan = xmlfolder + '/' + name + 'Fanart.png' else: fan = xmlfolder + '/' + name + 'Fanart.jpg' else: fan = '' main.addDirc(name, url, 239, thumb, '', fan, '', '', '') else: dialog = xbmcgui.Dialog() dialog.ok("MashUp", "Please set Custom Xml file Path", "in Addon settings under Custom Channels tab") selfAddon.openSettings()
def GLOBALBCSearch(): keyb = xbmc.Keyboard('', 'Search Global BC') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() encode = urllib.quote(search) surl = 'http://globalnews.ca/national/videos/?video-search=' + encode link = main.OPENURL(surl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<a class=".+?" href="([^<]+)" title="([^<]+)"><img src="http://en.wordpress.com/imgpress.?url=([^<]+)w=300" alt=".+?"><div><h4>([^<]+)</h4>' ).findall(link) for url, name, thumb, cat in match: main.addPlayc('[COLOR red]' + cat + ':[/COLOR] ' + name, thumb, 167, thumb, '', '', '', '', '')
def LIST3arabtv(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('»', '').replace('→', '') match = re.compile( """><img src="([^<]+)".+?<a href="([^<]+)">([^<]+)</a></span>""", re.DOTALL).findall(link) for thumb, url, name in match: thumb = thumb.split('"')[0] if 'http' not in thumb: thumb = MAINURL + thumb thumb = thumb.replace(' ', '') if 'Episodes' in name or 'Shows' in name: name2 = re.compile( 'href="' + url + '">' + name + '</a></span>.+?><a href=".+?">([^<]+)</a>', re.DOTALL).findall(link) if name2: name2 = name2[0] else: name2 = '' main.addDir('[COLOR red]' + name + '[/COLOR] ' + name2, MAINURL + url, 356, thumb) else: if 'Clips' in name or 'Movies' in name: name2 = re.compile( 'href="' + url + '">' + name + '</a></span>.+?><a href=".+?">([^<]+)</a>', re.DOTALL).findall(link) if name2: name2 = name2[0] else: name2 = '' main.addPlayc('[COLOR red]' + name + '[/COLOR] ' + name2, MAINURL + url, 355, thumb, '', '', '', '', '') else: main.addPlayc(name, MAINURL + url, 355, thumb, '', '', '', '', '') paginate = re.compile('''<a class="page" href="([^<]+)">Next''').findall( link) if len(paginate) > 0: main.addDir('Next', MAINURL + paginate[0], 353, art + '/next2.png') main.GA("3Arabtv", "List")
def MAIN(): xbmcgui.Window(10000).clearProperty('MASH_SSR_TYPE') d = settings.getHomeItems() for index, value in sorted(enumerate(d), key=lambda x: x[1]): if value == None: continue if index == 0: main.addDirHome('Search', mainurl, 420, art + '/search2.png') elif index == 1: main.addDirHome("All Fav's", mainurl, 639, art + '/favsu.png') elif index == 2: main.addDirHome('A-Z', mainurl, 6, art + '/az2.png') elif index == 3: main.addDirHome('New Releases', mainurl + 'new-releases/', 1, art + '/new2.png') elif index == 4: main.addDirHome('Latest Added', mainurl + 'latest-added/', 1, art + '/latest2.png') elif index == 5: main.addDirHome('Featured Movies', mainurl + 'featured-movies/', 1, art + '/feat2.png') elif index == 6: main.addDirHome('Most Viewed', mainurl + 'most-viewed/', 1, art + '/view2.png') elif index == 7: main.addDirHome('Most Voted', mainurl + 'most-voted/', 1, art + '/vote2.png') elif index == 8: main.addDirHome('HD Releases', mainurl + 'latest-hd-movies/', 1, art + '/dvd2hd.png') elif index == 9: main.addDirHome('Genre', mainurl, 2, art + '/genre2.png') elif index == 10: main.addDirHome('By Year', mainurl, 7, art + '/year2.png') elif index == 11: main.addDirHome('Watch History', 'history', 222, art + '/whistory.png') elif index == 14: main.addDirHome('International', 'http://www.desirulez.net', 36, art + '/intl.png') elif index == 22: main.addDirHome('Kids Zone', mainurl, 76, art + '/kidzone2.png') main.addPlayc('MashUp Settings', mainurl, 1999, art + '/MashSettings.png', '', '', '', '', '')
def LINK(mname,murl,thumb,fan,desc): parts=[] link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match= re.compile('<a href="http://adf.ly/377117/(.+?)".+?target="_blank.+?>(.+?)</a>').findall(link) if len(match)==0: match= re.compile('<a class="btn btn-custom btn-medium btn-red btn-red " target=".+?" href="http://adf.ly/377117/(.+?)"><span style=".+?"><strong>(.+?)</strong>').findall(link) b=1 for url,name in match: name=name.replace('</b>','').replace('<b>','').replace('<span style="font-size: x-large;">','').replace('<span id="goog_1857978069"></span><span id="goog_1857978070"></span>','').replace('<span style="font-family: Verdana, sans-serif; font-size: x-large;">','').replace('<span style="font-family: Verdana, sans-serif; font-size: large;">','').replace('<span>','').replace('</span>','') http= re.compile('http://').findall(url) if len(http)==0: url='http://'+url if re.findall('part',name[0:4],re.I): name=mname+' '+name main.addPlayc(name,url,622,thumb,desc,fan,'','','') parts.append(('Part '+str(b),url)) b=b+1 if parts and len(parts)>1: main.addPlayc(mname+' [COLOR blue]Play All[/COLOR]',str(parts),622,thumb,desc,fan,'','','')
def SEARCHED(surl): main.GA("SideReel", "Search") from t0mm0.common.net import Net as net setCookie(MAINURL) response = net().http_GET(surl) link = response.content link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace(' ', '') link = cleanHex(link) match = re.compile( """<div class='show-image'><a href[^>]+?><img alt="(.+?) poster" src="([^"]+?)".{,450}?<a href[^>]+?>[^<]+?<(.+?)</form""", re.DOTALL).findall(link) for name, thumb, track in match: if "<div class='authenticated hidden track-show'>" in track: name = name + ' [COLOR blue]Tracking Show[/COLOR]' main.addPlayc(name, track + ' <xo>' + surl + '</xo>', 400, thumb, '', '', '', '', '') else: name = name + ' [COLOR orange]Track Show[/COLOR]' main.addPlayc(name, track + ' <xo>' + surl + '</xo>', 399, thumb, '', '', '', '', '')
def LIST2(mname,murl,thumb,desc): main.GA("AnimeFreak","List") link=main.OPENURL(murl) link=main.unescapes(link) match = re.compile("""onClick="javascript:loadParts.?\'(.+?)', \'\'.?" class="multi">(.+?)</a>""").findall(link) if len(match)==0: match = re.compile('<iframe .+?src="(.+?)".+?/iframe>').findall(link) for url in match: host=re.compile("http://(.+?).?/.+?").findall(url) for hname in host: name=hname.replace('www.','').replace('embed.','').replace('.co','').replace('.t','').replace('.e','') main.addPlayc(mname+' [COLOR red]'+name+'[/COLOR]',url,627,thumb,desc,'','','','') else: for url, name in match: match2 = re.compile('<iframe(.+?)/iframe>').findall(url) if len(match2)>=2: for url in match2: match = re.compile('src="(.+?)"').findall(url) if len(match)==0: match = re.compile("src='(.+?)'").findall(url) for url in match: host=re.compile("http://(.+?).?/.+?").findall(url) for hname in host: name=hname.replace('www.','').replace('embed.','').replace('.co','').replace('.t','').replace('.e','') main.addPlayc(mname+' [COLOR red]'+name+'[/COLOR]',url,627,thumb,desc,'','','','') main.addPlayc(mname+' [COLOR red]'+name+'[/COLOR]',url,627,thumb,desc,'','','','')
def MAIN(): xbmcgui.Window(10000).clearProperty('AFTERSHOCK_SSR_TYPE') d = settings.getHomeItems() for index, value in sorted(enumerate(d), key=lambda x:x[1]): if value==None: continue if index==0: main.addDirHome('Search',mainurl,constants.MOVIE25_SEARCH_HISTORY,art+'/search.png') elif index==1: main.addDirHome("All Fav's",mainurl,constants.MAIN_GLOBALFAV,art+'/favsu.png') elif index==2: main.addDirHome('A-Z',mainurl,constants.MOVIE_ATOZ,art+'/az.png') elif index==3: main.addDirHome('New Releases',mainurl + 'new-releases/',constants.MOVIE25_LISTMOVIES,art+'/new.png') elif index==4: main.addDirHome('Latest Added',mainurl + 'latest-added/',constants.MOVIE25_LISTMOVIES,art+'/latest.png') elif index==5: main.addDirHome('Featured Movies',mainurl + 'featured-movies/',constants.MOVIE25_LISTMOVIES,art+'/feat.png') elif index==6: main.addDirHome('Most Viewed',mainurl + 'most-viewed/',constants.MOVIE25_LISTMOVIES,art+'/view.png') elif index==7: main.addDirHome('Most Voted',mainurl + 'most-voted/',constants.MOVIE25_LISTMOVIES,art+'/vote.png') elif index==8: main.addDirHome('HD Releases',mainurl + 'latest-hd-movies/',constants.MOVIE25_LISTMOVIES,art+'/dvd2hd.png') elif index==9: main.addDirHome('Genre',mainurl,constants.MOVIE_GENRE,art+'/genre.png') elif index==10: main.addDirHome('By Year',mainurl,constants.MOVIE_YEAR,art+'/year.png') elif index==11: main.addDirHome('Watch History','history',constants.MAIN_HISTORY,art+'/whistory.png') elif index==12: main.addDirHome('International',desirulezurl,constants.DESIRULEZ_CHANNELS,art+'/intl.png') elif index==13: main.addDirHome('Hindi Movies',sominalurl,constants.HINDI_MOVIES_MENU,art+'/hindimovies.png') elif index==14: main.addDirHome('Live TV',mainurl,constants.LIVETV_MENU,art+'/live.png') elif index==22: main.addDirHome('Kids Zone',mainurl,constants.KIDZONE_MENU,art+'/kidzone.png') main.addPlayc('Aftershock Settings',mainurl,constants.MAIN_SETTINGS,art+'/MashSettings.png','','','','','')