One of the big things I wanted to do after taking on Dwelling of Duels maintenance is write some scripts to help automate a lot of the boring and tedious work. The most tedious thing is definitely handling the youtube uploads, since you would need to drag and drop all the videos onto the youtube uploader and then manually correct all the song titles. So, on Tuesday night I decided to dig in really heavy into the Youtube API and try to figure out how to automate uploads, tagging, and playlist creation.
I already had a script written to use ffmpeg to create simple videos with banner artwork that have each of the songs playing, so that was easy to work into this.
The DoD site generator already runs on Python so I just decided to piggyback off of that and use their Python examples. Took a bit of head scratching and tinkering with the API settings, but I was finally able to upload a video to youtube using a single script! I must have uploaded and deleted this tibone song 20 times in getting it to work. It was a simple step from there to uploading an entire folder (all set to private, of course), then pretty easy to log the video IDs of each one I created. Next up was playlist creation, which actually involves two steps, creating the playlist and then adding video IDs to it. Since I logged all of the video IDs when they were uploaded, it was easy to read that file back and immediately add those videos to the playlist after creation. I did have to make one tiny config file that lets me set the playlist name, and also the content that goes in each video description above the boilerplate.
The final step is for me to go and double check that the titles of the private videos/playlist aren't wonky on youtube, then once thats done I have ANOTHER script that goes through and flips the visibility to public for all of the videos and the playlist, using that same log file from before.
All of these scripts can be called independently if needed, but I have a batch file that I'm running which takes care of each step in sequence: creating mp4s from mp3s, getting video title data from the filename, uploading the mp4s, creating a new playlist and adding the videos to it, then flipping the privacy on all of the above. It's been more fun than I would have thought
Only downside is that the youtube api limits you to creating 10 playlists per 24 hours, and throttles you once you upload 50 videos in a day. Not a dealbreaker for any normal month, but kinda sucks for me trying to catch up on the past year's worth of content.
You can view my github for this here : https://github.com/K...f-duels-scripts