Peter Stuifzand

Create your own YouTube playlists

A few days ago Mindcrack Ultra Hardcore season 11 started. In Ultra Hardcore the play by special rules, that are different from vanilla Minecraft. The biggest difference is that players don’t regenerate health automatically. They need to eat golden apples to increaes their health. These apples are harder to make, because you need golden ingots instead of golden nuggets.

Each season players record videos of their perspective of the match and post these videos to their YouTube channel. This season these videos are posted every other day around 22:00 UTC. This is mostly to give viewers the opportunity to watch multiple perspectives. The total running time for the first episode was about 7 hours. That’s a lot of video to watch.

At the moment the best way to watch these videos is to subscribe to a channel and follow along whenever a video is posted. The problem (for me) is that these players post many other videos of games that I don’t like to watch. There also isn’t a place where these videos are linked in one place. To remedy this problem I wrote a few programs that create the playlists automatically.

Let’s start with the output. The program created a few playlists on YouTube from the videos that I gathered from the channel. I created two views into the videos.

The first view is the list of videos for each player. Each player has a playlist with all the videos in episode order. For example the playlist for Zisteau. There is also a playlist for the other players.

The second view is a list of all videos in each episode. This means that the videos happened around the same 20 minutes of play time. For example all videos from episode 1. The other episodes are also available.

To create these playlists I wrote three Perl scripts. The first one gets the latest episodes for each players. This way I get a list of the last videos of the channel. This list contains all videos, also videos that I don’t want to add to the playlist.

In the next step (with the other two scripts) I parse the titles of the videos and find the videos that match the regular expressions for UHC or Ultra Hardcore and Season 11. Here I also try to find the episode number of the video.

Next I create a playlist or find the playlist_id of the episode (or player) and add all the videos that haven’t been added yet.

Now we’re done. I used the WebService::GData::Youtube module for calling the YouTube API, as it removes most of the dirty work.

© 2023 Peter Stuifzand