Random Network Movie By wrybread@gmail.com wrybread.com/utilities ############## # WHAT IS IT? ############## This is a little program that chooses a random song or movie from your whole network. It can also search for a specific song, which is super convenient when your media is spread out over 5 or so computers. ##################### # INSTALLATION NOTES ##################### Put these files anywhere you'd like on your network or local computer. I like to create a folder called c:\random_movie and run it from there. Note that config.txt has to be in the same directory as random_network_movie.exe. If you're going to be running this from other computers on your network, obviously share that folder. Remember to open config.txt and set the network paths of your movie and music files. The format should be pretty self-explanatory when you look at the existing config.txt file, which are my personal settings. ######## # USAGE ######## - Clicking random_network_movie.exe chooses a random movie from the whole network and plays it in your default movie player (Zoom Player or VLC are of course highly recommended). - It gets its movie locations from the config file. - to save time it creates temp files in a /temp subfolder that have the locations of your files. The first time you run Random Network Movie it'll generate that file. If you add or remove any network paths, you'll want to regenerate those files. The easiest way to do that is to simply delete the temp subfolder, or see the Advanced section below to force a regeneration. Note that there's a variable in the config file "hours_before_regeneration", which is the number of hours old the temp file is allowed to get before it's regenerated. - If you want to exclude any folders, put them in the "@exclude=" section of the config file. The exclusions can be a full network path, or a name. - If you're going to use random network movie from commandline, skip to the Command Line and Advanced Stuff section below. If not, here's some descriptions of how to build Windows shortcuts that'll do various cool things: - If you want to only choose, say, a random Simpsons, create a shortcut to random_network_movie.exe and right-click the shortcut and choose Properties and look at the target line and add "filter=simpsons" after the path. So the whole line would look exactly like: \\yada\Random_Movie\random_network_movie.exe filter=simpsons (The above assumes you have your Random Network Movie folder shared as "Random_Movie" on a computer called "Yada"). The following line would choose any Simpsons or South Park. Note that you need to replace any spaces in your filter with % characters, and there's no space after the comma: \\yada\Random_Movie\random_network_movie.exe filter=south%park,simpsons ########################### # PLAYLIST OF RANDOM MOVIES ########################### This gets you a Zoom Player Playlist (zpl) of 20 random movies, which is the default playlist length: \\yada\Random_Movie\random_network_movie.exe type=movie_playlist If you want to change the length of the playlist, do it like this. This gives you a 100 song playlist: \\yada\Random_Movie\random_network_movie.exe type=movie_playlist:100 There's a sample shortcut in \\yada\Random_Movie called "Random Movies (Playlist of 20)". Copy it to your desktop or wherever. You can also use filters with playlists. This gets you a playlist of 20 movies with Southpark in their titles or folder names: \\yada\Random_Movie\random_network_movie.exe type=movie_playlist filter=southpark ############### # RANDOM SONG ############### - And if you want to choose a random song, add "type=music" to the above example. For example this would choose a random song: \\yada\Random_Movie\random_network_movie.exe type=music This would choose a random Devo song: \\yada\Random_Movie\random_network_movie.exe type=music filter=devo This would choose a random Devo or Rolling Stones song: \\yada\Random_Movie\random_network_movie.exe type=music filter=devo,rolling%stones And the music locations are stored in \\yada\Random_Movie\music_locations.txt. ########################### # PLAYLIST OF RANDOM SONGS ########################### This gets you a playlist of 20 random songs, which is the default playlist length: \\yada\Random_Movie\random_network_movie.exe type=music_playlist If you want to change the length of the playlist, do it like this. This gives you a 100 song playlist: \\yada\Random_Movie\random_network_movie.exe type=music_playlist:100 There's a sample shortcut in \\yada\Random_Movie called "Random Songs (Playlist of 20)". Copy it to your desktop or wherever. You can also use filters with playlists. This gets you a playlist of 20 songs with circus in their titles or folder names: \\yada\Random_Movie\random_network_movie.exe type=music_playlist filter=circus ########################## # PROMPT FOR A RANDOM SONG ########################## \\yada\Random_Movie\random_network_movie.exe type=music-prompt This will spawn a dialog box, and type whatever into that box And this is the same but will give you a playlist of 20: \\yada\Random_Movie\random_network_movie.exe type=music_playlist-prompt ################################# # COMMAND LINE AND ADVANCED STUFF ################################# Commandline usage is like this: random_network_movie.exe filter=simpsons type=movie Type can be movie, movie_playlist, music, music_playlist, movie-prompt, movie_playlist-prompt, music-prompt, music_playlist-prompt, or regenerate. If no type is specified it defaults to movie. You can add "-nogui" to any type to suppress the gui. For example, type=music-nogui" would search for a song, and if it didn't find one with the search terms you supplied it wouldn't give you the popup window saying it didn't find anything. This is especially useful for scheduling an automatic rebuild of the temp files every night, as I like to do. Use a program like nnCron to schedule a rebuild of the temp files and you won't have to see the progress bar. The "regenerate" type simply regenerates the data file without picking a file. For the types "music_playlist" and "movie_playlist" you can set the length of the playlist like this: random_network_movie.exe filter=simpsons type=movie_playlist:30 That would create a 30 movie long playlist. If no number is specified it makes a 20 song playlist. The types with "prompt" in their names spawn a dialog box that asks what filter you'd like to use. Obviously you can't manually specify a filter with these types. If you have spaces in your commandline, surround that parameter with quotes. For example: random_network_movie.exe filter="robot chicken" type=movie You can also replace the spaces with % characters, like this: random_network_movie.exe filter=robot%chicken type=movie You can have multiple filters, like this: random_network_movie.exe filter="robot chicken","south park" type=movie It doesn't matter what order you put the commandline options, and if something isn't present it just goes with the default. For example executing random_network_movie.exe alone would choose a random movie. Feel free to email me if anything's not clear. wrybread@gmail.com