def FAVS(): favpath = os.path.join(main.datapath, 'Favourites') moviefav = os.path.join(favpath, 'Movies') FavFile = os.path.join(moviefav, 'Fav') if os.path.exists(FavFile): Favs = re.compile('url="(.+?)",name="(.+?)"').findall( open(FavFile, 'r').read()) for url, name in Favs: name = name.replace('-', '').replace('&', '').replace('acute;', '') url = url.replace('(', '').replace('[', '') if url[0] == 'm': url = 'http://movie25.com/' + url link = main.OPENURL(url) match = re.compile( '<div class="movie_pic"><a href="(.+?)" target="_blank">' ).findall(link) for thumb in match: main.addInfo(name, url, 3, thumb, '', '') else: xbmc.executebuiltin( "XBMC.Notification([B][COLOR green]Mash Up[/COLOR][/B],[B]You Have No Saved Favourites[/B],5000," ")") main.GA("None", "Movie25-Fav") xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def LISTMOVIES(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall( 'movie_pic"><a href="([^"]+)" target=".+?<img src="(.+?)".+?target="_self">([^<]+)</a>.+?>([^<]+)</a>.+?<br/>Views: <span>(.+?)</span>.+?(.+?)votes.*?<li class="current-rating" style="width:(\d+?)px', 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 url, thumb, name, genre, views, votes, rating in match: votes = votes.replace('(', '') name = name.replace('-', '').replace('&', '').replace('acute;', '').strip() main.addInfo( name + '[COLOR blue] Views: ' + views + '[/COLOR] [COLOR red]Votes: ' + votes + '[/COLOR] [COLOR green]Rating: ' + rating + '/100[/COLOR]', MainUrl + url, 3, thumb, genre, '') 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("None", "Movie25-list") paginate = re.compile('</a><a href=\'([^<]+)\'>Next</a>').findall(link) if paginate: # main.addDir('[COLOR red]Home[/COLOR]','',2000,art+'/home.png') main.addDir('[COLOR red]Enter Page #[/COLOR]', murl, 207, art + '/gotopage.png') xurl = MainUrl + paginate[0] r = re.findall('>Next</a><a href=\'/.+?/(\d+)\'>Last</a>', link) pg = re.findall('/.+?/(\d+)', paginate[0]) pg = int(pg[0]) - 1 if r: main.addDir( '[COLOR blue]Page ' + str(pg) + ' of ' + r[0] + '[/COLOR]', xurl, 1, art + '/next2.png') else: main.addDir('[COLOR blue]Page ' + str(pg) + '[/COLOR]', xurl, 1, art + '/next2.png') xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def LISTSHOWS(murl, channel, index=False): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall( '<div class="titleline"><h2 class="forumtitle"><a href="(.+?)">(.+?)</a></h2></div>', link) label = 'TV Shows' if not len(match) > 0: match = re.findall( '<h3 class="threadtitle">.+?<a class=".+?" href="(.+?)" id=".+?">(.+?)</a></h3>', link) label = 'Movies' dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until ' + label + ' Show list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = label + ' 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 url, name in match: if "color" in name: name = name.replace('<b><font color=red>', '[COLOR red]').replace('</font></b>', '[/COLOR]') name = name.replace('<b><font color="red">', '[COLOR red]').replace('</font></b>', '[/COLOR]') if label == 'Movies': main.addDirX(name, MainUrl + url, 39, '', searchMeta=True, metaType='Movies') else: main.addTVInfo(name, MainUrl + url, 38, getShowImage(channel, name), '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = label + ' 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 xbmcplugin.setContent(int(sys.argv[1]), label) main.VIEWS()
def YEARB(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<div class="movie_pic"><a href="(.+?)" target=".+?"> <img src="(.+?)" width=".+?" height=".+?" />.+?<a href=".+?" target=".+?">(.+?)</a></h1><div class=".+?">Genre: <a href=".+?" target=\'.+?\'>(.+?)</a>.+?Release:.+?<br/>Views: <span>(.+?)</span>.+?id=RateCount_.+?>(.+?)</span> votes.*?<li class="current-rating" style="width:(\d+?)px' ).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 url, thumb, name, genre, views, votes, rating in match: name = name.replace('-', '').replace('&', '').replace('acute;', '') furl = 'http://movie25.com/' + url main.addInfo( name + '[COLOR blue] Views: ' + views + '[/COLOR] [COLOR red]Votes: ' + votes + '[/COLOR] [COLOR green]Rating: ' + rating + '/100[/COLOR]', furl, 3, thumb, genre, '') 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 ye = murl[38:45] r = re.findall( "Next</a><a href='search.php.?page=([^<]+)&year=.+?'>Last</a>", link) if r: main.addDir('[COLOR red]Enter Page #[/COLOR]', murl, 208, art + '/gotopage.png') main.addDir('[COLOR blue]Page 1 of ' + r[0] + '[/COLOR]', 'http://www.movie25.so/search.php?page=2&year=' + str(ye), 9, art + '/next2.png') else: main.addDir('[COLOR blue]Page 1[/COLOR]', 'http://www.movie25.so/search.php?page=2&year=' + str(ye), 9, art + '/next2.png') xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def SEARCHTV(url=''): encode = main.updateSearchFile(url, 'TV') if not encode: return False surl = base_url + 'index.php?search=' + encode + '&tv=&x=0&y=0' link = main.OPENURL(surl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall( '<a href="([^"]*)"><img alt="[^"]*" src="([^"]*)" /></a><div class="title"><a title="[^"]*" href="[^"]*">([^"]*)</a></div><ul class=\'star-rating\'><li class="current-rating" style="[^"]*"></li></ul><div class="item-genres"><a href="[^"]*">([^"]*)</a>', 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 url, thumb, name, genre in match: name = name.replace('-', '').replace('&', '').replace('acute;', '').strip() main.addDir(name + '[COLOR blue] Genre: ' + genre + '[/COLOR]', base_url + url, 12, '', '') 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 nextpage = re.compile( '<a href="([^"]*)" class="next">Next »</a>').findall(link) for url in nextpage: main.addDir('Next Page >>', base_url + url, 1, art + '/next.jpg') xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def LISTMOVIES(murl, index=False): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall( 'lass="item"><a href="([^"]*)"><img alt=".+?src="([^"]*)" /></a><div class="title"><a title="watch movie([^"]*)".+?<div class="year"> ([^"]*)</div>', 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 url, thumb, name, date in match: name = name.upper() main.addInfo(name + '[COLOR blue] ' + date + '[/COLOR]', MainUrl + url, 50, thumb, '', '') 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( '<a href="([^"]*)" class="next">Next »</a>').findall(link) if paginate: xurl = MainUrl + paginate[0] main.addDir('[COLOR blue]Next Page ->[/COLOR]', xurl, 1, art + '/next.jpg', index=index) xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def LISTEPISODES(tvshowname, url): link = main.OPENURL(url) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall('<a class=".+?" href="(.+?)" id=".+?">(.+?)</a>', link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until [' + tvshowname + '] Episodes are cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Episodes 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 url, name in match: if "Online" not in name: continue name = name.replace(tvshowname, '').replace('Watch Online', '') name = main.removeNonASCII(name) main.addTVInfo(name, MainUrl + url, 39, '', '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = 'Episodes 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 match = re.findall( '<div id="above_threadlist" class="above_threadlist">(.+?)</div>', link) for string in match: match1 = re.findall('<a href="(.+?)" title="(.+?)">[0-9]+</a>', string) for url, page in match1: main.addTVInfo(page, MainUrl + url, 38, '', '', '') dialogWait.close() del dialogWait xbmcplugin.setContent(int(sys.argv[1]), 'TV Shows') main.VIEWS()
def TV(url): link = main.OPENURL(url) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall( '<a href="([^"]*)"><img alt="[^"]*" src="([^"]*)" /></a><div class="title"><a title="[^"]*" href="[^"]*">([^"]*)</a></div><ul class=\'star-rating\'><li class="current-rating" style="[^"]*"></li></ul><div class="item-genres"><a href="[^"]*">([^"]*)</a>', link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Shows list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Shows loaded :: [B]' + str(loadedLinks) + ' / ' + str( totalLinks) + '[/B].' dialogWait.update(0, '[B]Will load instantly from now on[/B]', remaining_display) for url, thumb, name, genre in match: main.addDirTE( '[COLOR green]' + name + '[/COLOR]' + '[COLOR blue] Genre: ' + genre + '[/COLOR]', base_url + url, 12, thumb, '', '', '', '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = 'Shows 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 nextpage = re.compile( '<a href="([^"]*)" class="next">Next »</a>').findall(link) for url in nextpage: main.addDir('[COLOR aqua]' + 'Next Page >>' + '[/COLOR]', base_url + url, 11, art + '/next.png') xbmcplugin.setContent(int(sys.argv[1]), 'TV') main.VIEWS()
def TV(url): link = main.OPEN_URL(url) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.findall( 'class="item"><a href="([^"]*)"><img alt=".+?src="([^"]*)" /></a><div class="title"><a title="watch tv([^"]*)" href=".+?<div class="year"> ([^"]*)</div>', link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Shows list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Shows loaded :: [B]' + str(loadedLinks) + ' / ' + str( totalLinks) + '[/B].' dialogWait.update(0, '[B]Will load instantly from now on[/B]', remaining_display) for url, thumb, name, date in match: main.addDirTE(name + ' ' + date, MainUrl + url, 22, thumb, '', '', '', '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = 'Shows 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 nextpage = re.compile( '<a href="([^"]*)" class="next">Next »</a>').findall(link) for url in nextpage: main.addDir('[COLOR aqua]' + 'Next Page >>' + '[/COLOR]', MainUrl + url, 11, art + '/next.jpg') xbmcplugin.setContent(int(sys.argv[1]), 'TV') main.VIEWS()
def SEARCH(url=''): encode = main.updateSearchFile(url, 'Movies') if not encode: return False surl = 'http://www.filmesonlinegratis.net/?s=' + encode + '&s-btn=Buscar' link = main.OPEN_URL(surl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('– ', ' - ') match = re.findall( 'title="([^"]*)">[^"]*</a></h2><divclass="capa"> <ahref="([^"]*)"><imgsrc="http://static.filmesonlinegratis.net/thumb.php[?]src=([^"]*)&w=135&h=185" alt="[^"]*" title="[^"]*" /></a> <spanclass="qualidade">([^"]*)</span>', 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, quality in match: #main.addDirb(name+'[COLOR blue] Quality: '+quality+'[/COLOR]',str(url),8,thumb,'') main.addInfo(name + '[COLOR blue] Quality: ' + quality + '[/COLOR]', url, 8, thumb, '', '') 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 nextpage = re.compile('href="([^"]*)">\xc2\xbb</a>').findall(link) for url in nextpage: main.addDir('Next Page >>', base_url + url, 1, art + '/next.png') xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def TV(url): link = main.OPEN_URL(url) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace( ' ', '').replace('– ', ' - ').replace('#038;', '') match = re.findall( 'title="([^"]*)">[^"]*</a></h2><div class="capa"><a href="([^"]*html)"><img src="http://static.filmesonlinegratis.net/thumb.php[?]src=([^"]*)&w=135&h=185" alt="[^"]*" title="[^"]*" /></a>', link) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Series list is cached.') totalLinks = len(match) loadedLinks = 0 remaining_display = 'Series 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: #main.addInfo(name,url,10,thumb,'','') main.addDirTE(name, str(url), 6, thumb, '', '', '', '', '') loadedLinks = loadedLinks + 1 percent = (loadedLinks * 100) / totalLinks remaining_display = 'Series 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 nextpage = re.compile('href="([^"]*)">\xc2\xbb</a>').findall(link) for url in nextpage: main.addDir('[COLOR aqua]' + 'Next Page >>' + '[/COLOR]', base_url + url, 11, art + '/next.png') xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def LISTMOVIES(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<div class="movie_pic"><a href="(.+?)" ><img src="(.+?)" width=".+?" height=".+?" alt=".+?" /></a></div> <div class=".+?"> <div class=".+?"> <h1><a href=".+?" >(.+?)</a></h1> <div class=".+?">Genre: <a href=".+?" title=\'.+?\'>(.+?)</a>.+?Release:.+?<br/> Views: <span>(.+?)</span>.+?<span>(.+?)</span> votes.+?<div id=".+?">score:<span id=Rate_.+?>(.+?)</span></div>' ).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 url, thumb, name, genre, views, votes, rating in match: name = name.replace('-', '').replace('&', '').replace('acute;', '') main.addInfo( name + '[COLOR blue] Views: ' + views + '[/COLOR] [COLOR red]Votes: ' + votes + '[/COLOR] [COLOR green]Rating: ' + rating + '[/COLOR]', url, 3, thumb, genre, '') 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("None", "Movie25-list") paginate = re.compile( 'http://www.movie25.com/movies/.+?/index-(.+?).html').findall(murl) if (len(paginate) == 0): purl = murl + 'index-2.html' r = re.findall( 'Next</a><a href="index-(.+?).html" title="Last" >Last</a>', link) if r: main.addDir('[COLOR red]Enter Page #[/COLOR]', murl, 207, art + '/gotopage.png') exist = re.findall('<a href="index-.+?" class=".+?">Next</a>', link) if exist: main.addDir('[COLOR blue]Page 2[/COLOR]', purl, 1, art + '/next2.png') else: paginate = re.compile( 'http://www.movie25.com/movies/(.+?)/index-(.+?).html').findall( murl) for section, page in paginate: pg = int(page) + 1 xurl = main.Mainurl + str(section) + '/' + 'index-' + str( pg) + '.html' main.addDir('[COLOR red]Home[/COLOR]', '', 2000, art + '/home.png') r = re.findall( 'Next</a><a href="index-(.+?).html" title="Last" >Last</a>', link) if r: main.addDir('[COLOR red]Enter Page #[/COLOR]', murl, 207, art + '/gotopage.png') exist = re.findall('<a href="index-.+?" class=".+?">Next</a>', link) if exist: main.addDir('[COLOR blue]Page ' + str(pg) + '[/COLOR]', xurl, 1, art + '/next2.png') xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()
def NEXTPAGE(murl): link = main.OPENURL(murl) link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') match = re.compile( '<div class="movie_pic"><a href="(.+?)" target=".+?"> <img src="(.+?)" width=".+?" height=".+?" /> </a></div> <div class=".+?"> <div class=".+?"> <h1><a href=".+?" target=".+?"> (.+?) </a></h1> <div class=".+?">Genre: <a href=".+?" target=\'.+?\'>(.+?)</a>.+?Release:.+?Views: <span> (.+?) </span>.+?<span id=RateCount.+?> (.+?) </span> votes.+?<div id=".+?">score:<span id=Rate_.+?>(.+?)</span>' ).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 url, thumb, name, genre, views, votes, rating in match: name = name.replace('-', '').replace('&', '').replace('acute;', '') furl = 'http://movie25.com/' + url main.addInfo( name + '[COLOR blue] Views: ' + views + '[/COLOR] [COLOR red]Votes: ' + votes + '[/COLOR] [COLOR green]Rating: ' + rating + '[/COLOR]', furl, 3, thumb, genre, '') 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 matchx = re.compile( 'http://www.movie25.com/search.php.+?page=(.+?)&year=(.+?)').findall( murl) if len(matchx) > 0: durl = murl + '/' paginate = re.compile( 'http://www.movie25.com/search.php.+?page=(.+?)&year=(.+?)/' ).findall(durl) for page, yearb in paginate: pgs = int(page) + 1 jurl = 'http://www.movie25.com/search.php?page=' + str( pgs) + '&year=' + str(yearb) main.addDir('[COLOR red]Home[/COLOR]', '', 0, art + '/home.png') r = re.findall( "Next</a><a href='search.php.?page=.+?year=.+?'>Last</a>", link) if r: main.addDir('[COLOR red]Enter Page #[/COLOR]', murl, 208, art + '/gotopage.png') exist = re.findall("<a href='search.php.?page=.+?'>Next</a>", link) if exist: main.addDir('[COLOR blue]Page ' + str(pgs) + '[/COLOR]', jurl, 9, art + '/next2.png') xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS() else: durl = murl + '/' paginate = re.compile( 'http://www.movie25.com/search.php.+?page=(.+?)&key=(.+?)/' ).findall(durl) for page, search in paginate: pgs = int(page) + 1 jurl = 'http://www.movie25.com/search.php?page=' + str( pgs) + '&key=' + str(search) main.addDir('[COLOR red]Home[/COLOR]', '', 0, art + '/home.png') exist = re.findall("<a href='search.php.?page=.+?'>Next</a>", link) if exist: main.addDir('[COLOR blue]Page ' + str(pgs) + '[/COLOR]', jurl, 9, art + '/next2.png')
def LISTMOVIES(murl, index=False): link = main.OPENURL(murl) result = common.parseDOM(link, "div", attrs={"class": "movie_table"}) result = common.parseDOM(result, "div", attrs={"class": "movie_pic"}) dialogWait = xbmcgui.DialogProgress() ret = dialogWait.create('Please wait until Movie list is cached.') totalLinks = len(result) 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)") print result for item in result: title = common.parseDOM(item, "a", ret="title")[0] url = common.parseDOM(item, "a", ret="href")[0] thumb = common.parseDOM(item, "img", ret="src")[0] title = title.replace('-', '').replace('&', '').replace('acute;', '').strip() title = title.encode('utf-8') if index == 'True': main.addInfo(title, MainUrl + url, 21, thumb, '', '') else: main.addInfo(title, MainUrl + url, constants.MOVIE25_VIDEOLINKS, thumb, '', '') 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 link = link.replace('\r', '').replace('\n', '').replace('\t', '').replace(' ', '') paginate = common.parseDOM(link, "div", attrs={"class": "count_text"})[0] href = common.parseDOM(paginate, "a", ret="href") content = common.parseDOM(paginate, "a") indx = 0 pageNo = 0 lastPg = 0 pageIndx = 0 for i in content: if i == "Next": pageNo = re.findall('/.+?/(\d+)', href[indx]) if len(pageNo) == 0: pageNo = re.findall("search.php.?page=([^<]+)&year=.+?", href[indx]) href[indx] = "/" + href[indx] pageNo = int(pageNo[0]) pageIndx = indx if i == "Last": lastPg = re.findall('/.+?/(\d+)', href[indx]) if len(lastPg) == 0: lastPg = re.findall("search.php.?page=([^<]+)&year=.+?", href[indx]) href[indx] = "/" + href[indx] if len(lastPg) > 0: lastPg = int(lastPg[0]) else: lastPg = 0 indx = indx + 1 searchPage = re.findall("search.php.?page=([^<]+)&year=.+?", href[pageIndx]) if not len(searchPage) > 0 and lastPg > 0: main.addDir('[COLOR red]Enter Page #[/COLOR]', murl, constants.MOVIE25_GOTOPAGE, art + '/gotopage.png', index=index) if lastPg > 0: main.addDir('[COLOR blue]Page ' + str(pageNo) + ' of ' + str(lastPg) + '[/COLOR]', MainUrl + href[pageIndx], constants.MOVIE25_LISTMOVIES, art + '/next.png', index=index) elif pageNo <> lastPg: main.addDir('[COLOR blue]Page ' + str(pageNo) + '[/COLOR]', MainUrl + href[pageIndx], constants.MOVIE25_LISTMOVIES, art + '/next.png', index=index) xbmcplugin.setContent(int(sys.argv[1]), 'Movies') main.VIEWS()