Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-youtube-lyte domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/robohara/public_html/www.robohara.com/wp-includes/functions.php:6114) in /home4/robohara/public_html/www.robohara.com/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":12261,"date":"2019-12-02T06:06:12","date_gmt":"2019-12-02T12:06:12","guid":{"rendered":"http:\/\/www.robohara.com\/?p=12261"},"modified":"2019-12-01T22:51:31","modified_gmt":"2019-12-02T04:51:31","slug":"setting-up-movie-nights-with-a-powershell-script","status":"publish","type":"post","link":"https:\/\/www.robohara.com\/?p=12261","title":{"rendered":"Setting up Movie Nights with a PowerShell Script"},"content":{"rendered":"

\"\"<\/p>\n

I love watching movies, but miss the theater experience — and by that I mean trailers and concession commercials, not gum on the floor, people talking, and kids kicking the back of my seat. I decided to write a script using PowerShell to try and enhance my home movie experience. The result, which I’ve named MovieNight.ps1, is pretty neat!<\/p>\n

I’m splitting today’s blog post into two parts. The first half will be the fun half where I talk about what the script does. The first half won’t be technical at all. In the second half I’ll get into the technical details. If you’re not interested in all the nerdy behind-the-scenes stuff, that’ll be a good place to drop off.<\/p>\n

Part One: What’s It Do?<\/b><\/p>\n

I love all the little clips theaters show before the movie starts. I like the commercials, the trailers, and what theaters call their “policy” trailers (the clips that ask you not to smoke, talk, litter, or use your cell phone). My goal was to write a script that would randomly pick files from each of those categories and add them to a playlist. A playlist is a plain text file that simply tells whatever video player you use on your computer to show videos (or play music) in a specific order. The way I wanted the script to work was for me to tell it what movie I wanted to watch, and then have it quickly generate a playlist. One of the most important parts of the script was its ability to randomly pick the files. I want to be surprised by which trailers and commercials it adds to the playlist, otherwise it’s no fun!<\/p>\n

Doing this required obtaining hundreds and hundreds of video clips off the internet, and sorting them into separate folders. A friend of mine sent me approximately 800 video clips to get me started; since then, I’ve acquired another 500. Most of the movie trailers and theater commercials were downloaded from YouTube. Once I had all of those files, I had to sort and resort them into folders that made sense so that the script could pull filenames from the different folders. <\/p>\n

After all that sorting, I settled on the following folders: audio format promos, commercials, feature presentation, policy trailers, trailers, and welcome. Under commercials there are three additional folders: food and drink, intermission, and misc. <\/p>\n

Lots of the commercials came from old drive-in clips. Here’s an example of one of the clips under the “food and drink” commercial folder.<\/p>\n

<\/div><\/div>
<\/div>
<\/div>
<\/div><\/div><\/div>