Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto update YT Descriptions using the YouTube API #1621

Merged
merged 6 commits into from
Dec 2, 2024
Merged

Conversation

dipamsen
Copy link
Member

@dipamsen dipamsen commented Jun 14, 2024

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.)

Copy link

netlify bot commented Jun 14, 2024

Deploy Preview for codingtrain ready!

Name Link
🔨 Latest commit f733015
🔍 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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shiffman
Copy link
Member

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!

@dipamsen
Copy link
Member Author

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

@shiffman
Copy link
Member

shiffman commented Jul 3, 2024

Apologies for the delay @dipamsen I hope to try this out soon! Thanks for your patience!

@shiffman shiffman mentioned this pull request Aug 27, 2024
3 tasks
@fturmel
Copy link
Collaborator

fturmel commented Nov 17, 2024

@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

@shiffman
Copy link
Member

shiffman commented Dec 2, 2024

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?

@shiffman shiffman merged commit 8b9cb00 into main Dec 2, 2024
6 checks passed
@shiffman shiffman deleted the auto-update-yt-desc branch December 2, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants