def ESPNList(murl): link = main.OPENURL(murl) match = re.compile( '"videoDuration":"(.+?)",.+?"video":.+?{"headline":"(.+?)",.+?,"includePlatforms":.+?,"imageUrl":"(.+?)","mobileSubHead":"(.+?)","internalUrl720p":"(.+?)",' ).findall(link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Sports list is loaded.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Videos loaded :: [B]' + str( loadedLinks) + ' / ' + str(totalLinks) + '[/B].' dialogWait.update(0, '[B]Loading....[/B]', remaining_display) for dur, name, thumb, desc, url, in match: dur = dur.replace('00:', '') main.addPlayMs(name, url, 46, thumb, desc, '', dur, '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = 'Videos loaded :: [B]' + str( loadedLinks) + ' / ' + str(totalLinks) + '[/B].' dialogWait.update(percent, '[B]Loading....[/B]', remaining_display) if (dialogWait.iscanceled()): return False dialogWait.close() del dialogWait main.GA("ESPN", "ESPN-List")
def LISTJL(mname, murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('\xc2\xa0', '') if mname == 'LATEST VIDEOS' or 'lvpage' in murl: match = re.compile( '<!-- START OF LATEST VIDEOS-->(.+?)<!-- END OF LATEST VIDEOS-->', re.DOTALL).findall(link)[0] if mname == 'MOST VIEWED' or 'mvvpage' in murl: match = re.compile( '<!-- START OF MOST VIEWED VIDEOS-->(.+?)<!-- END OF MOST VIEVED VIDEOS-->', re.DOTALL).findall(link)[0] if mname == 'HIGHEST RATED' or 'hrvpage' in murl: match = re.compile( '<!-- START OF HIGHEST RATED VIDEOS-->(.+?)<!-- END OF HIGHEST RATED VIDEOS-->', re.DOTALL).findall(link)[0] if mname == 'FEATURED' or 'fvpage' in murl: match = re.compile( '<!-- START OF FEATURED VIDEOS-->(.+?)<!-- END OF FEATURED VIDEOS-->', re.DOTALL).findall(link)[0] match2 = re.compile( 'style="font-weight:bold;">([^<]+).+?<a href="([^<]+)"><img class=".+?" src="(.+?)" alt=(.+?)', re.DOTALL).findall(match) else: match2 = re.compile( 'style="font-weight:bold;">([^<]+).+?<a href="([^<]+)"><img class=".+?" src="(.+?)" title="(.+?)"', re.DOTALL).findall(match) for name, url, thumb, desc in match2: main.addPlayMs(name, url, 320, thumb, desc, '', '', '', '') paginate = re.compile('href="([^<]+)">Next</a>').findall(match) if len(paginate) > 0: main.addDir('Next', MAINURL + paginate[0], 319, art + '/next2.png') main.GA("John Locker", "List")
def LISTNG2(murl): MainUrl = 'http://video.nationalgeographic.com' link = main.OPENURL(murl) match2 = re.compile( 'http://video.nationalgeographic.com/video/animals').findall(murl) match3 = re.compile( 'http://video.nationalgeographic.com/video/kids').findall(murl) match = re.compile( '<a href="(.+?)" title="(.+?)"><img src="(.+?)"></a>').findall(link) for url, name, thumb in match: name = name.replace("'", "'").replace('<i>', '').replace( '</i>', '').replace('"', '"').replace('&quot;', '"').replace('&', '&') if (len(match2) == 0) and (len(match3) == 0): main.addPlayMs(name, MainUrl + url, 74, MainUrl + thumb, '', '', '', '', '') else: main.addPlayMs(name, MainUrl + url, 75, MainUrl + thumb, '', '', '', '', '') paginate = re.compile( """\n if ((.+?) === (.+?)) .+?\n .+?<li><a href="(.+?)">Next »</a></li>""" ).findall(link) if (len(paginate) > 0): for pges, pg, pgtot, purl in paginate: pg = pg.replace('(', '') pgtot = pgtot.replace(')', '') if pgtot != pg: main.addDir('Page ' + str(int(pg) + 1), MainUrl + purl + pg + '/', 73, art + '/next2.png') main.GA("NG-Show", "List")
def ViceList(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','') match=re.compile('''<a data-id=".+?" href="([^"]+)" onClick=".+?"><div class="media"><img src="(.+?)" alt="">.+?</p><h3>(.+?)</h3>''').findall(link) for url,thumb,name in match: url='http://www.vice.com'+url main.addPlayMs(name,url,106,thumb,'','','','','')
def SKYSPORTSList2(murl): main.GA("SkySports", "List") link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') page = re.compile('data-current-page=".+?" data-pattern="(.+?)">').findall( link) if len(page) > 0: for durl in page: durl = durl.replace('{currentPage}', '1').replace('/12/', '/75/') link2 = main.OPENURL('http://www1.skysports.com' + durl) link2 = link2.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '') match = re.compile( '<a href="([^"]+)" class=".+?data-src="([^"]+)" class=".+?<h4 class=".+?">([^<]+)</h4>.+?">([^<]+)</p>.+?">([^<]+)</button>' ).findall(link) for url, thumb, name, date, typ in match: thumb = thumb.replace('16-9/#{30}', '384x216') if name != 'Sky Sports News Report': if typ == 'Watch Now': main.addPlayMs(name + ' [COLOR red]' + date + '[/COLOR]', url, 174, thumb, '', '', '', '', '') else: main.addPlayMs( '[COLOR red]' + name + '[/COLOR]' + ' ' + date, url, 177, thumb, '', '', '', '', '') else: xbmc.executebuiltin( "XBMC.Notification(Sorry!,No Video's to list,3000)")
def MUSICLIST(mname, murl): link = main.OPENURL(murl, ua=useragent) fan = re.findall('"banner":"(.+?)",', link, re.DOTALL)[0] match = re.findall( '{"id":".+?","link":"(.+?)","name":"(.+?)","year":"(.+?)","pic":"(.+?)"}', link, re.DOTALL) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Song list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Songs Cached :: [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 url, name, year, thumb in match: main.addPlayMs( mname + ' [COLOR red]' + name + ' (' + year + ')[/COLOR]', url, 279, thumb.replace('\/', '/'), '', fan.replace('\/', '/'), '', '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = 'Songs Cached :: [B]' + str( loadedLinks) + ' / ' + str(totalLinks) + '[/B].' dialogWait.update(percent, '[B]Will load instantly from now on[/B]', remaining_display) if dialogWait.iscanceled(): break main.GA("Mbox", "Music")
def LIST(murl): main.GA("DocumentaryWire", "List") link = main.OPENURL(murl) link = main.unescapes(link) r = re.findall( """<div class="loop-content switchable-view grid-small" data-view="grid-small">(.+?)<div class=\'wp-pagenavi\'>""", link, ) if r: match = re.compile( '<div class="thumb"><a class=".+?" data-id=".+?" title="(.+?)" href="(.+?)"><span class=".+?"><img src="(.+?)" alt=".+?" />.+?<p class="desc">(.+?)</p>' ).findall(r[0]) else: match = re.compile( '<div class="thumb"><a class=".+?" data-id=".+?" title="(.+?)" href="(.+?)"><span class=".+?"><img src="(.+?)" alt=".+?" />.+?<p class="desc">(.+?)</p>' ).findall(link) for name, url, thumb, desc in match: main.addPlayMs(name, url, 228, thumb, desc, "", "", "", "") paginate = re.compile("""'extend'>...</span><a href=\'(.+?)\' class="next">Next.+?</a>""").findall(link) if len(paginate) == 0: paginate = re.compile( """<div class='wp-pagenavi'>.+?class='page larger'>[^\&]+</a><a href=\'([^\&]+)\' class="next">Next.+?</a>""" ).findall(link) if len(paginate) > 0: for purl in paginate: main.addDir("[COLOR blue]Next[/COLOR]", purl, 227, art + "/next2.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,236,thumb) match=re.compile('<title>([^<]+)</title.+?link>(.+?)</link.+?thumbnail>([^<]+)</thumbnail>').findall(link) for name,url,thumb in sorted(match): main.addPlayMs(name+' [COLOR blue]'+vip+'[/COLOR]',url,183,thumb,'',fan,'','','')
def SEARCH(murl): if murl == 's12dnm': keyb = xbmc.Keyboard('', 'Search Documentaries') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() encode = urllib.quote(search) surl = 'http://www.documentarywire.com/?s=' + encode else: surl = murl link = main.OPENURL(surl) link = main.unescapes(link) match = re.compile( '<a class=".+?" data-id=".+?" title="(.+?)" href="(.+?)"><span class=".+?"><img src="(.+?)" alt=".+?" />.+?<p class="desc">(.+?)</p>' ).findall(link) for name, url, thumb, desc in match: main.addPlayMs(name, url, 228, thumb, desc, '', '', '', '') paginate = re.compile( """'extend'>...</span><a href=\'(.+?)\' class="next">Next.+?</a>""" ).findall(link) if (len(paginate) == 0): paginate = re.compile( """<div class='wp-pagenavi'>.+?class='page larger'>[^\&]+</a><a href=\'([^\&]+)\' class="next">Next.+?</a>""" ).findall(link) if (len(paginate) > 0): for purl in paginate: main.addDir('[COLOR blue]Next[/COLOR]', purl, 229, art + '/next2.png')
def LISTNG2(murl): MainUrl = "http://video.nationalgeographic.com" link = main.OPENURL(murl) match2 = re.compile("http://video.nationalgeographic.com/video/animals").findall(murl) match3 = re.compile("http://video.nationalgeographic.com/video/kids").findall(murl) match = re.compile('<a href="(.+?)" title="(.+?)"><img src="(.+?)"></a>').findall(link) for url, name, thumb in match: name = ( name.replace("'", "'") .replace("<i>", "") .replace("</i>", "") .replace(""", '"') .replace("&quot;", '"') .replace("&", "&") ) if (len(match2) == 0) and (len(match3) == 0): main.addPlayMs(name, MainUrl + url, 74, MainUrl + thumb, "", "", "", "", "") else: main.addPlayMs(name, MainUrl + url, 75, MainUrl + thumb, "", "", "", "", "") paginate = re.compile( """\n if ((.+?) === (.+?)) .+?\n .+?<li><a href="(.+?)">Next »</a></li>""" ).findall(link) if len(paginate) > 0: for pges, pg, pgtot, purl in paginate: pg = pg.replace("(", "") pgtot = pgtot.replace(")", "") if pgtot != pg: main.addDir("Page " + str(int(pg) + 1), MainUrl + purl + pg + "/", 73, art + "/next2.png") main.GA("NG-Show", "List")
def LISTBB(murl): main.GA("BodyBuilding","List") link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('img src="http://assets.bodybuilding.com','') match=re.compile('''img src="(.+?)".+? title="(.+?)" /></a>.+?<h3>.+?<a href=\'(.+?)'> .+? </a>.+?Muscle Targeted:.+?> (.+?) </a>''').findall(link) for thumb,name,url,body in match: main.addPlayMs(name+" [COLOR red]"+body+"[/COLOR]",url,197,thumb,'','','','','')
def MMAFList(murl): main.GA("MMA", "MMA-Fighting") if murl == 'http://www.mmafighting.com/videos': link = main.OPENURL(murl) #link=main.unescapes(link) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<img alt=.+? data-original="([^<]+)" em_content=.+?<a href=".+?href=".+?href=".+?<h3><a href="(.+?)">(.+?)</a></h3>' ).findall(link) for thumb, url, name in match: main.addPlayMs(name, url, 114, thumb, '', '', '', '', '') main.addDir('Next', 'http://www.mmafighting.com/videos/archives', 113, "%s/art/next2.png" % selfAddon.getAddonInfo("path")) else: link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<img alt=.+? data-original="([^<]+)" em_content=.+?<a href=".+?href=".+?href=".+?<h3><a href="(.+?)">(.+?)</a></h3>' ).findall(link) for thumb, url, name in match: main.addPlayMs(name, url, 114, thumb, '', '', '', '', '') paginate = re.compile('<a href="([^<]+)" rel="next">Next</a>').findall( link) if len(paginate) > 0: main.addDir('Next', paginate[0], 113, "%s/art/next2.png" % selfAddon.getAddonInfo("path")) main.VIEWSB()
def ESPNList(murl): if 'http://espn.go.com/video/' in murl: lurl=murl xurl=re.findall('(.+?)&pageNum=',murl)[0] else: lurl='http://espn.go.com/video/format/libraryPlaylist?categoryid='+murl xurl='http://espn.go.com/video/format/libraryPlaylist?categoryid='+murl link=main.OPENURL(lurl) match=re.compile('<a href="([^<]+)"><img src="(.+?)".+?></a><h5>(.+?)</h5>',re.DOTALL).findall(link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Sports list is loaded.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Videos loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].' dialogWait.update(0,'[B]Loading....[/B]',remaining_display) for url,thumb,name in match: main.addPlayMs(name,url,46,thumb,'','','','','') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100)/totalLinks remaining_display = 'Videos loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].' dialogWait.update(percent,'[B]Loading....[/B]',remaining_display) if (dialogWait.iscanceled()): return False dialogWait.close() del dialogWait match=re.compile('class="page-numbers">(\d+) of (\d+)</div>',re.DOTALL).findall(link) for p1,p2 in match: continue if p1 != p2: purl=xurl+ "&pageNum=" + str(int(p1)) + "&sortBy=&assetURL=http://assets.espn.go.com&module=LibraryPlaylist&pagename=vhub_index" main.addDir('[COLOR blue]Next[/COLOR] Page '+p1+' of '+p2,purl,45,art+'/next2.png') main.GA("ESPN","ESPN-List")
def ListglobalFavMs(): from universal import favorites fav = favorites.Favorites(addon_id, sys.argv) fav_items = fav.get_my_favorites(section_title="Sports Favs", item_mode='addon') if len(fav_items) > 0 : for fav_item in fav_items: if (fav_item['isfolder'] == 'false'): main.addPlayMs(fav_item['title'],fav_item['infolabels'].get('item_url',''), fav_item['infolabels'].get('item_mode',''), fav_item['image_url'], fav_item['infolabels'].get('plot',''), fav_item['fanart_url'], fav_item['infolabels'].get('duration',''), fav_item['infolabels'].get('genre',''), fav_item['infolabels'].get('year','')) else: main.addDirMs(fav_item['title'],fav_item['infolabels'].get('item_url',''), fav_item['infolabels'].get('item_mode',''), fav_item['image_url'], fav_item['infolabels'].get('plot',''), fav_item['fanart_url'], fav_item['infolabels'].get('duration',''), fav_item['infolabels'].get('genre',''), fav_item['infolabels'].get('year','')) else: xbmc.executebuiltin("XBMC.Notification([B][COLOR white]Sports-A-Holic[/COLOR][/B],[B]You Have No Saved Favourites[/B],5000,"")") xbmcplugin.setContent(int(sys.argv[1]), 'Movies')
def LISTWB(murl): furl='http://staticswf.kidswb.com/kidswb/xml/videofeedlight.xml' link=main.OPENURL(furl) link=link.replace('"','').replace(''','').replace('×','').replace('&','').replace('‘','').replace('–','').replace('“','').replace('”','').replace('—','').replace('&','&').replace("`",'') match = re.compile('<item><media:title>([^<]+)</media:title><media:description>([^<]+)</media:description><guid isPermaLink="false">([^<]+)</guid><av:show season="1">'+murl+'</av:show><media:thumbnail url="([^<]+)"/></item>').findall(link) for name,desc,url,thumb in match: main.addPlayMs(name,url,79,thumb,desc,'','','','')
def SEARCH(murl): if murl == "s12dnm": keyb = xbmc.Keyboard("", "Search Documentaries") keyb.doModal() if keyb.isConfirmed(): search = keyb.getText() encode = urllib.quote(search) surl = "http://www.documentarywire.com/?s=" + encode else: surl = murl link = main.OPENURL(surl) link = main.unescapes(link) match = re.compile( '<a class=".+?" data-id=".+?" title="(.+?)" href="(.+?)"><span class=".+?"><img src="(.+?)" alt=".+?" />.+?<p class="desc">(.+?)</p>' ).findall(link) for name, url, thumb, desc in match: main.addPlayMs(name, url, 228, thumb, desc, "", "", "", "") paginate = re.compile("""'extend'>...</span><a href=\'(.+?)\' class="next">Next.+?</a>""").findall(link) if len(paginate) == 0: paginate = re.compile( """<div class='wp-pagenavi'>.+?class='page larger'>[^\&]+</a><a href=\'([^\&]+)\' class="next">Next.+?</a>""" ).findall(link) if len(paginate) > 0: for purl in paginate: main.addDir("[COLOR blue]Next[/COLOR]", purl, 229, art + "/next2.png")
def MUSICLIST(mname, murl): link = main.OPENURL(murl, ua=useragent) fan = re.findall('"banner":"(.+?)",', link, re.DOTALL)[0] match = re.findall('{"id":".+?","link":"(.+?)","name":"(.+?)","year":"(.+?)","pic":"(.+?)"}', link, re.DOTALL) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create("Please wait until Song list is cached.") totalLinks = len(match) loadedLinks = 0 remaining_display = "Songs Cached :: [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 url, name, year, thumb in match: main.addPlayMs( mname + " [COLOR red]" + name + " (" + year + ")[/COLOR]", url, 279, thumb.replace("\/", "/"), "", fan.replace("\/", "/"), "", "", "", ) loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = "Songs Cached :: [B]" + str(loadedLinks) + " / " + str(totalLinks) + "[/B]." dialogWait.update(percent, "[B]Will load instantly from now on[/B]", remaining_display) if dialogWait.iscanceled(): break main.GA("Mbox", "Music")
def ViceList(murl): main.GA("Vice","Vice-list") link=main.OPENURL(murl) match=re.compile('<img src="(.+?)" alt="" width=".+?" height=".+?">\n <span class=".+?"></span>\n </a>\n <h2><a onClick=".+?" href="(.+?)">(.+?)</a></h2>').findall(link) for thumb,url,name in match: url='http://www.vice.com'+url main.addPlayMs(name,url,106,thumb,'','','','','')
def LIST(mname,murl): items=[] i=0 if 'http' in murl: text = main.OPENURL(murl) else: f = open(murl) text = f.read() name=re.findall('<title>([^<]+)</title>',text) for names in name: name=re.findall('<title>([^<]+)</title>',text) url=re.findall('<link>([^<]+)</link>',text) thumb=re.findall('<thumbnail>([^<]+)</thumbnail>',text) if thumb: thumb=thumb[i] else: thumb='' items.append({ 'title': name[i], 'thumbnail': thumb, 'path': url[i] }) i=i+1 for channels in items: main.addPlayMs(channels['title'],channels['path'],240,channels['thumbnail'],'','','','','')
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", "") ) if re.findall("\d+.\d+.\d+.\d+", host): host = "Static" main.addPlayMs( mname + " [COLOR blue]" + host.upper() + "[/COLOR]", url, 240, art + "/hosts/" + host.lower() + ".png", "", art + "/hosts/" + host.lower() + ".png", "", "", "", )
def LIST(murl): date = re.search('(\d+)-(\d{2})-(\d{2})', murl) xurl = 'http://mlb.mlb.com/gdcross/components/game/mlb/year_' + date.group( 1) + '/month_' + date.group(2) + '/day_' + date.group(3) + '/grid.json' dialog = xbmcgui.Dialog() ret = dialog.select('Choose Type', ['Condensed Games', 'Highlights']) if ret == -1: return if ret == 0: link = main.OPENURL(xurl) match = re.compile( '{"id":"([^"]+)","playback_scenario":"FLASH_1800K_.+?","state":"MEDIA_ARCHIVE","type":"condensed_game"}.+?"away_team_name":"([^"]+)".+?"home_team_name":"([^"]+)".+?"home_file_code":"([^"]+)"', re.DOTALL).findall(link) for id, away, home, fname in match: thumb = 'http://mlb.mlb.com/mlb/images/team_logos/logo_' + fname + '_79x76.jpg' mod = id[-3:] url = 'http://m.mlb.com/gen/multimedia/detail/' + mod[ 0] + '/' + mod[1] + '/' + mod[2] + '/' + id + '.xml' main.addPlayMs(away + " at " + home, url, 449, thumb, '', '', '', '', '') if ret == 1: link = main.OPENURL(xurl) match = re.compile( '"away_team_name":"([^"]+)".+?"home_team_name":"([^"]+)".+?"game_pk":"([^"]+)".+?"home_file_code":"([^"]+)"', re.DOTALL).findall(link) for away, home, id, fname in match: thumb = 'http://mlb.mlb.com/mlb/images/team_logos/logo_' + fname + '_79x76.jpg' main.addDir(away + " at " + home, id, 450, thumb)
def LIST(murl): main.GA("DocumentaryWire", "List") link = main.OPENURL(murl) link = main.unescapes(link) r = re.findall( """<div class="loop-content switchable-view grid-small" data-view="grid-small">(.+?)<div class=\'wp-pagenavi\'>""", link) if r: match = re.compile( '<div class="thumb"><a class=".+?" data-id=".+?" title="(.+?)" href="(.+?)"><span class=".+?"><img src="(.+?)" alt=".+?" />.+?<p class="desc">(.+?)</p>' ).findall(r[0]) else: match = re.compile( '<div class="thumb"><a class=".+?" data-id=".+?" title="(.+?)" href="(.+?)"><span class=".+?"><img src="(.+?)" alt=".+?" />.+?<p class="desc">(.+?)</p>' ).findall(link) for name, url, thumb, desc in match: main.addPlayMs(name, url, 228, thumb, desc, '', '', '', '') paginate = re.compile( """'extend'>...</span><a href=\'(.+?)\' class="next">Next.+?</a>""" ).findall(link) if (len(paginate) == 0): paginate = re.compile( """<div class='wp-pagenavi'>.+?class='page larger'>[^\&]+</a><a href=\'([^\&]+)\' class="next">Next.+?</a>""" ).findall(link) if (len(paginate) > 0): for purl in paginate: main.addDir('[COLOR blue]Next[/COLOR]', purl, 227, art + '/next2.png')
def LISTBF(murl): main.GA("FitnessBlender","List") link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('–','-') main.addLink("[COLOR red]Body Focus [/COLOR]"+"[COLOR yellow]Calorie Burn [/COLOR]"+"[COLOR blue]Difficulty [/COLOR]"+"[COLOR green]Duration[/COLOR]",'','') match=re.compile('<a class="teaser group" href="(.+?)"><div class=".+?<img id=".+?" class="fit_img.+?data-original="(.+?)" alt="([^"]+)".+?"><p>Calorie Burn:(.+?)</p><p>Minutes:(.+?)</p><p>Difficulty:(.+?)</p><p>Body Focus:(.+?)</p></div>').findall(link) for url,thumb,name,cal,dur,diff,bf in match: main.addPlayMs(name+" [COLOR red]"+bf+"[/COLOR]"+"[COLOR yellow]"+cal+"[/COLOR]"+"[COLOR blue]"+diff+"[/COLOR]"+"[COLOR green]"+dur+"[/COLOR]",'http://www.fitnessblender.com/'+url,203,thumb,'','','','','')
def OCList(murl): link = main.OPENURL(murl) match = re.compile( '<item><titl[^>]+>([^<]+)</title><description>(.+?)</description>.+?<plrelease:url>(.+?)</plrelease:url></plfile:release></media:content><pubDate>.+?</pubDate><plmedia:defaultThumbnailUrl>(.+?)</plmedia:defaultThumbnailUrl>' ).findall(link) for name, desc, url, thumb in match: main.addPlayMs(name, url, 52, thumb, desc, '', '', '', '') main.GA("Sports", "OC-List")
def YOUList(mname,durl): murl='https://gdata.youtube.com/feeds/api/playlists/'+durl+'?start-index=1&max-results=50' link=main.OPENURL(murl) match=re.compile("href='https://m.youtube.com/details.?v=(.+?)'/.+?<media\:descriptio[^>]+>([^<]+)</media\:description>.+?<media\:thumbnail url='([^']+)'.+?<media:title type='plain'>(.+?)/media:title>").findall(link) for url,desc,thumb,name in match: name=name.replace('<','') main.addPlayMs(name,url,206,thumb,desc,'','','','') main.GA(mname,"Youtube-List")
def LIST2(mname, murl, thumb, desc): main.GA("GolfChannel", "List") match = re.compile('<a href="(.+?)" class="showLinks">(.+?)</a>').findall( murl) for url, name in match: main.addPlayMs(mname + " [COLOR red]" + name + "[/COLOR]", 'http://www.golfchannel.com' + url, 220, thumb, '', '', '', '', '')
def LISTWT(murl): main.GA("Wildtv","Wildtv-list") link=main.OPENURL(murl) match=re.compile('alt="Video: (.+?)" href="(.+?)">\r\n<img class=".+?" src="(.+?)"').findall(link) for name, url, thumb in match: thumb='https:'+thumb url='https://www.wildtv.ca/' +url main.addPlayMs(name,url,94,thumb,'','','','','')
def YOUList(mname,durl): murl='http://gdata.youtube.com/feeds/api/users/'+durl+'/uploads?start-index=1&max-results=50' link=main.OPENURL(murl) match=re.compile("http\://www.youtube.com/watch\?v\=([^\&]+)\&.+?<media\:descriptio[^>]+>([^<]+)</media\:description>.+?<media\:thumbnail url='([^']+)'.+?<media:title type='plain'>(.+?)/media:title>").findall(link) for url,desc,thumb,name in match: name=name.replace('<','') main.addPlayMs(name,url,48,thumb,desc,'','','','') main.GA(mname,"Youtube-List")
def ViceList(murl): main.GA("Vice", "Vice-list") link = main.OPENURL(murl) match = re.compile( '<img src="(.+?)" alt="" width=".+?" height=".+?">\n <span class=".+?"></span>\n </a>\n <h2><a onClick=".+?" href="(.+?)">(.+?)</a></h2>' ).findall(link) for thumb, url, name in match: url = 'http://www.vice.com' + url main.addPlayMs(name, url, 106, thumb, '', '', '', '', '')
def TSNLIST(murl): main.GA("TSN","TSN-list") murl=murl+'&pageSize=200' link=main.OPENURL(murl) match = re.compile('<id>(.+?)</id>.+?<title><(.+?)></title><description><(.+?)></description><imgUrl>(.+?)</imgUrl>').findall(link) for url,name,desc,thumb in match: name=name.replace('![CDATA[','').replace(']]','').replace('/',' ') desc=desc.replace('![CDATA[','').replace(']]','').replace('/',' ') main.addPlayMs(name,url,98,thumb,desc,'','','','')
def FOXSOCList(murl): main.GA("FoxSoccer","List") link=main.OPENURL(murl) match=re.compile('<video xmlns=".+?">(.+?)</video>').findall(link) for entry in match: name=re.compile('<title>([^<]+)</title>').findall(entry) desc=re.compile('<description>([^<]+)</description>').findall(entry) thumb=re.compile('<file formatCode="2001".+?<uri>([^<]+)</uri></file>').findall(entry) main.addPlayMs(name[0],entry,126,thumb[0],desc[0],'','','','')
def LISTWT(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('\xc2\xa0','') match=re.compile('<a title="(.+?)" alt=".+?" href="(.+?)"><img class=".+?src="(.+?)" />',re.DOTALL).findall(link) for name, url, thumb in match: thumb='https:'+thumb url='https://www.wildtv.ca' +url main.addPlayMs(name,url,94,thumb,'','','','','')
def WATCHDOCList2(murl): #main.GA("WatchDocumentary","List") link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match=re.compile('<a href="([^<]+)" title="([^<]+)"><img src="([^<]+)" alt=').findall(link) for url,name,thumb in match: main.addPlayMs(name,url,161,thumb,'','','','','') paginate=re.compile('<a href="([^<]+)">next »</a>').findall(link) if (len(paginate)>0): for purl in paginate: main.addDir('[COLOR blue]Next[/COLOR]','http://watchdocumentary.org/'+purl,163,art+'/next2.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','') if re.findall('\d+.\d+.\d+.\d+',host): host='Static' main.addPlayMs(mname+' [COLOR blue]'+host.upper()+'[/COLOR]',url,240,art+'/hosts/'+host.lower()+'.png','',art+'/hosts/'+host.lower()+'.png','','','')
def LISTVD(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('\xc2\xa0','') match=re.compile('<a class="video_thumb".+?src="(.+?)".+?<span class="time"> (.+?) </span>.+?<p class="title"><a href="([^<]+)" rel=".+?" title="([^<]+)">.+?<p>(.+?)</p>',re.DOTALL).findall(link) for thumb,dur,url,name,desc in match: main.addPlayMs(name+' [COLOR red]('+dur+')[/COLOR]',url,333,thumb,desc,'','','','') paginate = re.compile('href="([^<]+)" >Next</a>',re.DOTALL).findall(link) if len(paginate)>0: main.addDir('Next',paginate[0],332,art+'/next2.png') main.GA("Video Documentaire","List")
def LISTWT(murl): main.GA("Wildtv", "Wildtv-list") link = main.OPENURL(murl) match = re.compile( 'alt="Video: (.+?)" href="(.+?)">\r\n<img class=".+?" src="(.+?)"' ).findall(link) for name, url, thumb in match: thumb = 'https:' + thumb url = 'https://www.wildtv.ca/' + url main.addPlayMs(name, url, 94, thumb, '', '', '', '', '')
def LISTDISC(mname, murl): thumbList = [] dsc = re.findall("dsc.discovery", murl) if dsc: turl = "http://dsc.discovery.com" mil = re.findall("military.discovery", murl) if mil: turl = "http://military.discovery.com" sci = re.findall("science.discovery", murl) if sci: turl = "http://science.discovery.com" velo = re.findall("velocity.discovery", murl) if velo: turl = "http://velocity.discovery.com" ap = re.findall("animal.discovery", murl) if ap: turl = "http://animal.discovery.com" linka = main.OPENURL(murl) r = re.findall('uri="/services/taxonomy/(.+?)/">', linka) nurl = ( turl + "/services/taxonomy/" + r[0] + "/?num=200&page=0&filter=clip%2Cplaylist%2Cfullepisode&tpl=dds%2Fmodules%2Fvideo%2Fall_assets_grid.html&sort=date&order=desc&feedGroup=video" ) link = main.OPENURL(nurl) Thumb = re.compile('<img src="(.+?)" />').findall(link) for thumb in Thumb: thumbList.append(thumb) match = re.compile( '<a href="(.+?)" class=".+?" data-track-rule=".+?" data-module-name=".+?" data-module-location=".+?" data-link-position=".+?" data-track-more=".+?">(.+?)</a></h4>\n <p class="clip-count-all">(.+?)</p>\n' ).findall(link) i = 0 for url, name, view in match: url = ( url.replace("http://animal.discovery.com", "") .replace("http://military.discovery.com", "") .replace("http://science.discovery.com", "") .replace("http://velocity.discovery.com", "") .replace("http://dsc.discovery.com", "") ) link = link.replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", "") Full = re.compile('<img src="([^<]+)" />[^<]+>Full Episode</span>').findall(link) Full = re.compile( '<span class="full-episode-flag">Full Episode</span>.+?<a href="(.+?)" class=".+?" data-track-rule=".+?"' ).findall(link) if Full: for ind in Full: if ind == url: name = name + " [COLOR red]Full Episode[/COLOR]" name = name.replace("'", "'").replace(""", '"').replace("&", "&") main.addPlayMs(name + " [COLOR blue]" + view + "[/COLOR]", turl + url, 65, thumbList[i], "", "", "", "", "") i = i + 1 main.GA("Discovery", mname + "-list")
def TSNLIST(murl): main.GA("TSN", "TSN-list") murl = murl + '&pageSize=200' link = main.OPENURL(murl) match = re.compile( '<id>(.+?)</id>.+?<title><(.+?)></title><description><(.+?)></description><imgUrl>(.+?)</imgUrl>' ).findall(link) for url, name, desc, thumb in match: name = name.replace('![CDATA[', '').replace(']]', '').replace('/', ' ') desc = desc.replace('![CDATA[', '').replace(']]', '').replace('/', ' ') main.addPlayMs(name, url, 98, thumb, desc, '', '', '', '')
def SKYSPORTSList(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match=re.compile('<a href="([^"]+)" class=".+?data-src="([^"]+)" class=".+?<h4 class=".+?">([^<]+)</h4>.+?">([^<]+)</p>.+?">([^<]+)</button>').findall(link) for url,thumb,name,date,typ in match: thumb=thumb.replace('16-9/#{30}','384x216') if name!='Sky Sports News Report': if typ=='Watch Now': main.addPlayMs(name+' [COLOR red]'+date+'[/COLOR]',url,174,thumb,'','','','','') else: main.addPlayMs('[COLOR red]'+name+'[/COLOR]'+' '+date,url,177,thumb,'','','','','')
def LIST3(murl): link=main.OPENURL(murl) link=main.unescapes(link) match = re.compile("""<a title="([^<]+)" target="" rel=".+? href="(.+?)"><img src=".+?onerror=".+?altVideoThumbnail.?this, '(.+?)'.?"></a>.+?<p class="ez-desc">(.+?)</p>""").findall(link) for name,url,thumb,desc in match: thumb=thumb.replace(' ','%20') main.addPlayMs(name,url,220,thumb,desc,'','','','') paginate = re.compile("""href="javascript:window.location='(.+?)';" class=".+?">Next</a><a title=".+?" rel=".+?" onclick=".+?""").findall(link) if len(paginate)>0: paginates=main.unescapes(paginate[0]) main.addDir('Next',paginates,221,art+'/next2.png')
def ViceList(murl): main.GA("Vice", "Vice-list") link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace(' ', '') match = re.compile( '''<a data-id=".+?" href="([^"]+)" onClick=".+?"><div class="media"><img src="(.+?)" alt="">.+?</p><h3>(.+?)</h3>''' ).findall(link) for url, thumb, name in match: url = 'http://www.vice.com' + url main.addPlayMs(name, url, 106, thumb, '', '', '', '', '')
def LISTJL2(mname,murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('\xc2\xa0','') if 'SEARCH' in mname or 'searchkey' in murl: match2=re.compile('style="font-weight:bold;">([^<]+).+?<a href="([^<]+)"><img class=".+?" src="(.+?)" alt=(.+?)',re.DOTALL).findall(link) else: match2=re.compile('style="font-weight:bold;">([^<]+).+?<a href="([^<]+)"><img class=".+?" src="(.+?)" title="(.+?)"',re.DOTALL).findall(link) if len(match2)==0: match2=re.compile('style="font-weight:bold;">([^<]+).+?<a href="([^<]+)"><img class=".+?" src="(.+?)" alt=(.+?)',re.DOTALL).findall(link) for name,url,thumb,desc in match2: main.addPlayMs(name,url,320,thumb,desc,'','','','') paginate = re.compile('href="([^<]+)">Next</a>').findall(link) if len(paginate)>0: main.addDir('Next',MAINURL+paginate[0],321,art+'/next2.png')
def TSNLIST(murl): link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace(' ','') match=re.compile('''href="([^"]+)"><span class="tileText"><span class="overlay"><img src="([^"]+)" style=.+?/><img class="videoOverlay" src=".+?" /></span><span class=".+?" style=".+?">([^<]+)</span></span>''').findall(link) for url,thumb,name in match: url=main.REDIRECT(url) main.addPlayMs(name,url,98,thumb,'','','','','') paginate=re.compile('_page=(\d+)&_',re.DOTALL).findall(murl) if paginate: purl=int(paginate[0])+ 1 xurl=re.sub('_page=(\d+)&_','_page='+str(purl)+'&_',murl) main.addDir('[COLOR blue]Next[/COLOR]',xurl,97,art+'/next2.png')
def SKYSPORTSList(murl): main.GA("SkySports","List") link=main.OPENURL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match=re.compile('<a href="(.+?)" class=".+?"> <img src=".+?" data-src="(.+?)" class=".+?"> <div class=".+?"><span class=".+?"></span></div> </a> </div> <div class=".+?"> <a href=".+?" class="-a-block"> <h4 class=".+?">(.+?)</h4> <p class=".+?">(.+?)</p> <button class=".+?">(.+?)</button>').findall(link) for url,thumb,name,date,typ in match: thumb=thumb.replace('16-9/#{30}','384x216') if name!='Sky Sports News Report': if typ=='Watch Now': main.addPlayMs(name+' [COLOR red]'+date+'[/COLOR]',url,174,thumb,'','','','','') else: main.addPlayMs('[COLOR red]'+name+'[/COLOR]'+' '+date,url,177,thumb,'','','','','')
def LIST2(murl): url='http://mlb.mlb.com/ws/search/MediaSearchService?start=0&site=mlb&hitsPerPage=50&hitsPerSite=10&type=json&c_id=mlb&src=vpp&sort=desc&sort_type=date&game_pk='+murl refUrl='http://mlb.mlb.com/search/media.jsp?game_pk='+murl req = urllib2.Request(url) req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36') req.add_header('Referer',refUrl) response = urllib2.urlopen(req) link=response.read() response.close() match = re.compile('{"src":"([^"]+)","type":".+?"}],"blurb":"([^"]+)","kicker":".+?","url":"([^"]+)",',re.DOTALL).findall(link) for thumb,name,url in match: main.addPlayMs(name,url,449,thumb,'','','','','')
def LISTWT(murl): main.GA("Wildtv", "Wildtv-list") link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('\xc2\xa0', '') match = re.compile( '<a title="(.+?)" alt=".+?" href="(.+?)"><img class=".+?src="(.+?)" />', re.DOTALL).findall(link) for name, url, thumb in match: thumb = 'https:' + thumb url = 'https://www.wildtv.ca' + url main.addPlayMs(name, url, 94, thumb, '', '', '', '', '')
def DISJRList2(murl): main.GA("DisneyJR","DisJR-list") link=main.OPENURL(murl) match = re.compile('{"duration":".+?","duration_sec".+?"duration_iso":".+?"id":".+?","slug":".+?","href":"(.+?)","title":"(.+?)","thumb":"(.+?)","description":"(.+?)","vType":"(.+?)",.+?}').findall(link) for url, name,thumb,desc,vtype in match: main.addPlayMs('[COLOR red]'+name+'[/COLOR] [COLOR yellow]"'+vtype+'"[/COLOR]',url,110,thumb,desc,'','','','') if len(match)==25 or len(match)==31: paginate=re.compile('(.+?)/video.?r=1-1&l=31&o=([^\&]+)').findall(murl) for url, page in paginate: i=int(page)+24 url=url.replace('json','more') purl=url+'/video?r=1-1&l=31&o='+str(i) main.addDir('[COLOR blue]Next[/COLOR]',purl,109,art+'/next2.png')
def LISTVD(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('\xc2\xa0', '') match = re.compile( '<a class="video_thumb".+?src="(.+?)".+?<span class="time"> (.+?) </span>.+?<p class="title"><a href="([^<]+)" rel=".+?" title="([^<]+)">.+?<p>(.+?)</p>', re.DOTALL).findall(link) for thumb, dur, url, name, desc in match: main.addPlayMs(name + ' [COLOR red](' + dur + ')[/COLOR]', url, 333, thumb, desc, '', '', '', '') paginate = re.compile('href="([^<]+)" >Next</a>', re.DOTALL).findall(link) if len(paginate) > 0: main.addDir('Next', paginate[0], 332, art + '/next2.png') main.GA("Video Documentaire", "List")
def LISTWB(murl): furl = 'http://staticswf.kidswb.com/kidswb/xml/videofeedlight.xml' link = main.OPENURL(furl) link = link.replace('"', '').replace(''', '').replace( '×', '').replace('&', '').replace('‘', '').replace( '–', '').replace('“', '').replace('”', '').replace( '—', '').replace('&', '&').replace("`", '') match = re.compile( '<item><media:title>([^<]+)</media:title><media:description>([^<]+)</media:description><guid isPermaLink="false">([^<]+)</guid><av:show season="1">' + murl + '</av:show><media:thumbnail url="([^<]+)"/></item>').findall(link) for name, desc, url, thumb in match: main.addPlayMs(name, url, 79, thumb, desc, '', '', '', '') main.GA("WB", "List")
def TSNLIST(murl): main.GA("TSN", "TSN-list") link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace(' ', '') match = re.compile( '''href="([^"]+)"><span class="tileText"><span class="overlay"><img src="([^"]+)" style=.+?/><img class="videoOverlay" src=".+?" /></span><span class=".+?" style=".+?">([^<]+)</span></span>''' ).findall(link) for url, thumb, name in match: url = main.REDIRECT(url) main.addPlayMs(name, url, 98, thumb, '', '', '', '', '') paginate = re.compile('_page=(\d+)&_', re.DOTALL).findall(murl) if paginate: purl = int(paginate[0]) + 1 xurl = re.sub('_page=(\d+)&_', '_page=' + str(purl) + '&_', murl) main.addDir('[COLOR blue]Next[/COLOR]', xurl, 97, art + '/next2.png')
def LIST(mname, murl): items = [] i = 0 if 'http' in murl: text = main.OPENURL(murl) else: f = open(murl) text = f.read() match = re.compile( '<title>([^<]+)</title.+?link>(.+?)</link.+?thumbnail>([^<]+)</thumbnail>', re.DOTALL).findall(text) for name, url, thumb in match: if '</sublink>' in url: main.addDirMs(name, url, 266, thumb, '', '', '', '', '') else: main.addPlayMs(name, url, 240, thumb, '', '', '', '', '')
def SEARCHVD(): keyb = xbmc.Keyboard('', 'Search Video Documentaire') keyb.doModal() if (keyb.isConfirmed()): search = keyb.getText() encode = urllib.quote(search) surl = 'http://video-documentaire.com/videoscategory/animaux/?s=' + encode + '&x=-1081&y=-167' link = main.OPENURL(surl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('\xc2\xa0', '') match = re.compile( '<a class="widget-title" href="([^<]+)"><img src="(.+?)" alt="(.+?)" title=".+?<p>(.+?)</p>', re.DOTALL).findall(link) for url, thumb, name, desc in match: main.addPlayMs(name, url, 333, thumb, desc, '', '', '', '')
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', '') if re.findall('\d+.\d+.\d+.\d+', host): host = 'Static' main.addPlayMs(mname + ' [COLOR blue]' + host.upper() + '[/COLOR]', url, 240, art + '/hosts/' + host.lower() + '.png', '', art + '/hosts/' + host.lower() + '.png', '', '', '')
def LIST2(murl): url = 'http://mlb.mlb.com/ws/search/MediaSearchService?start=0&site=mlb&hitsPerPage=50&hitsPerSite=10&type=json&c_id=mlb&src=vpp&sort=desc&sort_type=date&game_pk=' + murl refUrl = 'http://mlb.mlb.com/search/media.jsp?game_pk=' + murl req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36' ) req.add_header('Referer', refUrl) response = urllib2.urlopen(req) link = response.read() response.close() match = re.compile( '{"src":"([^"]+)","type":".+?"}],"blurb":"([^"]+)","kicker":".+?","url":"([^"]+)",', re.DOTALL).findall(link) for thumb, name, url in match: main.addPlayMs(name, url, 449, thumb, '', '', '', '', '')