Exercise media
The exercise library has no pictures or videos. The two usual sources do not have a free license. The images and videos of the dataset belong to Gym visual, and its MIT license excludes them. So gymgym never bundles or serves them. You can add media to your own instance in two ways.
Media you have licensed
Section titled “Media you have licensed”If you have a license for exercise images or animations, host them yourself. A public R2 bucket works. Then set MEDIA_BASE_URL to the place where they live. The app shows media only when this setting exists.
Video examples from YouTube
Section titled “Video examples from YouTube”Set the secret YOUTUBE_API_KEY to a Google Cloud key that has the YouTube Data API v3 turned on:
cd apps/webnpx wrangler secret put YOUTUBE_API_KEYThe “How to” tab of an exercise then shows up to three video examples, mostly in the language of the app. Each one has a thumbnail. The embedded player loads only when the person presses Play, and “Open on YouTube” is always there. The key never reaches the browser. The examples come from YouTube search, not from the coach, so they cost no model tokens. Instructions and “Ask the coach” work whether or not videos are available.
- The app shows only public results that you can embed, and it leaves out videos made for children. YouTube chooses the results, so availability and language vary.
- A search finds what YouTube thinks is related, and that is often another exercise. So gymgym asks for 15 results and checks each title. A video stays only if its title names the exercise, with the same variation (incline, reverse grip, one arm) and the same kind of equipment. Lists, comparisons, workouts and clips shorter than 10 seconds are left out. Videos of half a minute to six minutes come first.
- Some names say how the exercise is done: lying, seated, reverse grip. If no title names the exercise, or none gives that position or grip, gymgym searches a second time with the exact English name of the exercise, because many videos are titled with it. It then chooses from both searches. When some videos show the exact version, only those are shown. If nothing fits at all, the person sees no video and a link to search YouTube, and gymgym does not search again for that exercise for a day. A second search counts toward the daily limit.
- YouTube streams the videos. gymgym never downloads or copies them.
YOUTUBE_DAILY_SEARCH_LIMITlimits the searches. The default is 80 a day, counted by Pacific time. The maximum is 90, and 0 pauses new searches. gymgym caches results for about a week, and a cached result does not use the quota. After an update that changes how results are chosen, older cached results are not used.- gymgym removes cached video details within the 30-day refresh and delete policy of YouTube. You manage the search quota itself in Google Cloud. See search quota.
These examples do not replace licensed media. The Gym visual media of the catalog stays outside the MIT data license, and the YouTube examples never include it.