Play Random Videos

RunScript

Addons.ExecuteAddon

Skin usage

RunScript(script.playrandomvideos, "<list path>", "label=<list label>")

$ESCINFO[]

label

watchmode

singlevideo

MyVideoNav.xml

RunScript(script.playrandomvideos, "$INFO[Container.FolderPath]", "label=$INFO[Container.FolderName]", watchmode=$INFO[Control.GetLabel(10)])

Code: <visible>ListItem.IsFolder + !ListItem.IsParentFolder + !SubString(ListItem.FolderPath, plugin, Left) + !SubString(ListItem.FolderPath, addons, Left) + !SubString(ListItem.FolderPath, sources, Left) + !StringCompare(ListItem.FolderPath, add)</visible>

$ADDON[script.playrandomvideos 32100]

watchmode

MyVideoNav.xml

watchmode=$INFO[Control.GetLabel(10)]

singlevideo

Button/menu actions

RunScript(script.playrandomvideos, "videodb://movies/")

RunScript(script.playrandomvideos, "videodb://tvshows/")

RunScript(script.playrandomvideos, "videodb://musicvideos/")

RunScript(script.playrandomvideos, "special://playlists/video/<playlist filename>")

RunScript(script.playrandomvideos, "videodb://movies/genres/xx/", "label=Documentary")

RunScript(script.playrandomvideos, "videodb://tvshows/studios/xx/", "label=Cartoon Network")

Plugins

Troubles?

A Kodi add-on to quickly play random videos from (nearly) any list. This add-on can play random episodes from TV shows, movies from genres/sets/years/tags, and videosfrom playlists, file systems, and just about anything else*.It adds a context item to most playable lists of videos and provides a script that can be executed by skins withand JSON-RPC withInstall it from the official Kodi repo, under "Context menus".Source available on GitHub at script.playrandomvideos Skins can use it with an action like so:List path is the path to the list to play, like ListItem.FolderPath, which should be escaped ().is the list name, like ListItem.Label or FolderName, and is required when available, also escaped/quoted. There are optional arguments, which can override the default watch mode selected in the add-on settings, andto play just a single video, if you have occasion for such an action.Inan action likemakes for a good button in the sidebar or as some other container-focused option. Useto match the context item's visibility on this window.A label is available with, 'Play Random'.accepts 'Unwatched', 'Watched', and 'Ask me', as well as their localized equivalents with these IDs: `16101`, `16102`, and `36521`. Inshould match the behavior of the button that switches between watched/unwatched/all, if it is on your window.needs no value.It is also possible to create an action that always plays randomly from one specific list, for use in a home menu or even as flair on another window, which can be assigned with Skin Shortcuts or added directly to skin files.- Play randomly from a list of all movies:- all episodes:- all music videos:- from any of your playlists:- movies from any genre:- episodes from any TV network:It doesn't work for plugin paths. I would like it to, but I can't figure a good way to implement it, considering all the things plugins do.If you are experiencing an error, please post your log file and a brief description of the issue.