thecodingtrain.com
thecodingtrain.com copied to clipboard
Auto update YT Descriptions using the YouTube API
For now, this script only allows updating one video at a time, because of safety reasons, as well as the YouTube videos.update API has a high quota cost.
Obviously, this is untested code. (I have only tested the updateDescription function with a video on my channel.)
Deploy Preview for codingtrain ready!
| Name | Link |
|---|---|
| Latest commit | f733015b0df8f41f0a4f40c1364d73970ae770fa |
| Latest deploy log | https://app.netlify.com/sites/codingtrain/deploys/674de10b29395b000932a03d |
| Deploy Preview | https://deploy-preview-1621--codingtrain.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Hi @dipamsen, super excited about this! How about we set up a "dummy" channel to test this out on before deploying it with the CT channel itself? We could maybe hardcode a single video ID and use that over and over again? Let me know, I can work on that!
The current script is coded such that it only updates a single description at a time (to minimise damage), I think it can be directly tested on the actual channel on a obscure/non popular video, and in the worst case scenario where the description is lost, it can be manually restored via the generated description (yt-desc).
This way the entire workflow can be tested which involves getting the yt I'd of the video etc
Apologies for the delay @dipamsen I hope to try this out soon! Thanks for your patience!
@dipamsen Great job on this.
I had a thought earlier and wanted to share, feel free to dismiss!
The Coding Train channel has 1266 videos total (more than we have integrated in the site for sure). Since video.list() is cheap (1 quota unit) and you should be able to give it up to 50 ids per call, it would only cost up to 26 units to fetch the description of every single video.
From there, you could only offer to update the videos that have a different description than the one expected. Maybe you could even show a little diff between the two strings in the terminal before going through with the update?
See https://github.com/kpdecker/jsdiff
I was finally able to get this to work! I updated a toxiclibs video (https://youtu.be/E67e0RX-7Ew) that had a "typo" noted in #1770. I'm going to merge PR now. It would be no small task, but what I would love is something along the lines of what @fturmel suggestions with even a local server spinning up a simple UI to see the list of videos, look at what changes, and select videos to be updated. This is not something i have a lot of time to work on now, but maybe we open an issue and tackle in the future?