mattwright324 / youtube-metadata

A quick way to gather all the metadata about a video, playlist, or channel from the YouTube API.
https://mattw.io/youtube-metadata/
MIT License
367 stars 54 forks source link

Clearer instructions for YouTube API key usage when building #185

Closed kid-pro-kuo closed 2 weeks ago

kid-pro-kuo commented 2 weeks ago

Thanks for developing this excellent tool and making it available for all!

Apologies if I missed this somewhere in the documentation. I had the darndest time getting it to work when building locally; figured out that the YouTube API key provisioned from Cloud Console has to be base64 encoded before plugging into youtube-api-v3.js. Could be helpful to add to BUILD.md?

mattwright324 commented 2 weeks ago

Hey @kid-pro-kuo, the build instructions do state how to replace and use your own key if desired. It does not need to be base64 encoded

https://github.com/mattwright324/youtube-metadata/blob/da6469876aa7040c6bc71347f451a0e8df632366/js/youtube-api-v3.js#L71

You can remove the atob function and just pass in the plain api key value. I was doing it this way by decoding a base64 version of my key as a very simple counter against scraping since all API keys start with the same AIzaSy characters.

kid-pro-kuo commented 2 weeks ago

Ah that totally makes sense. Carry on the good work then!