test = addon.save_favorite() if test is False: addon.show_small_popup(msg='Unable to save favorite') else: addon.show_small_popup(msg='Favorite saved') elif mode == 'deletefavorite': addon.del_favorite() elif mode == 'showfavorites': favorites = addon.show_favorites( {'movies' : 'Movies', 'tv' : 'TV Shows' } ) if favorites: cm.add_favorite('Delete favorite',{ 'mode' : 'deletefavorite'}, 'deletefavorite', addon.queries['favtype'] ) for data in favorites: if data['callback'] == 'play': addon.add_item(data['url'], { 'title' : data['title']}, item_type=data['item_type'], cm=cm) else: addon.add_directory(data['queries'], data['title'], cm=cm) if not play: addon.end_of_directory()
url = addon.queries['url'] html = net.http_GET(url).content r = "<h1>(.+?) \((\d+)\)</h1>.+<b>IMDB:</b>.+<span>tt(\d+)</span>" meta = re.findall(r, html, re.DOTALL) r = "<a.+?href=\"javascript:show\('(\w+?)','(.+?)', '(.+?)'.+?<b>(\d+)% said work.+?<\/b>" regex = re.finditer(r, html, re.DOTALL) for s in regex: id, title, host, quality = s.groups() addon.add_item({'host': host, 'media_id' : id}, {'title': u'%s (%s)' % (meta[0][0] , host), 'date': int(meta[0][1]), 'code': int(meta[0][2]), 'rating': float(quality), 'studio': host}, img=addon.queries['imageurl'], is_folder=False, item_type='video') xbmcplugin.setContent( int( sys.argv[ 1 ] ), 'movies') xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_LABEL ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_STUDIO ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_UNSORTED ) xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RATING ) elif mode == 'main': # addon.show_small_popup('t0mm0 test addon', 'Is now loaded enjoy', 6000, logo) addon.add_directory({'mode': 'tv'}, {'title': 'TUBE+ TV'}) addon.add_directory({'mode': 'movies'}, {'title': 'TUBE+ Movies'}) addon.add_directory({'mode': 'movies', 'browse': 'latest'}, {'title': 'TUBE+ Movies (Latest Releases)'})