def trakt_play_random(list_items): random.seed() index = random.randint(0, len(list_items) - 1) list_item = list_items[index] if list_item['type'] == 'movie': id = list_item['movie']['ids']['tmdb'] play_movie(id)
def movies_play_choose_player(src, id, usedefault): from resources.lib.TheMovieDB import Find tmdb_id = None if src == 'tmdb': tmdb_id = id elif src == 'imdb': info = Find(id).info(external_source='imdb_id') tmdb_id = info['movie_results'][0]['id'] if not tmdb_id: plugin.notify('tmdb id', 'not found', plugin.get_addon_icon(), 3000) play_movies.play_movie(tmdb_id, usedefault)