Latest video ID incorrect

#5
by sgbaird - opened
Acceleration Consortium org
edited May 3, 2025

Should be https://www.youtube.com/live/hupn1SD_kqg?si=Zti1Dn1lnWnhL_BX, but instead is pulling http://www.youtube.com/watch?v=ZRz3u7yAukg

Maybe I broke it with my recent change? Perhaps most robust would be to do timestamp sorting, or maybe there's a more targeted way with the "Search API".

@j-woo @Neil-YL (can wait until next week, wish there was a schedule message option..)

Related to https://github.com/AccelerationConsortium/ac-training-lab/pull/234#issuecomment-2845977916

Acceleration Consortium org
edited May 3, 2025

Now it is correct. The API pulling is fine and the ordering in the playlist is correct.
Pulling latest video id is triggered by the rebuild of the space. We need to think of how to refresh the embedded video id without the rebuild.

Acceleration Consortium org

Ah, right! Forgot about that. Thanks! Sorry for the weekend msg

Acceleration Consortium org
edited May 7, 2025

I’ve committed an update to app.py. You can now update the video ID for the embedded stream using the refresh button.

(Not sure if we should find a way to restrict it on the admin side to prevent users from spamming the refresh button and consuming too many API tokens, although without search.list, it only uses 2 tokens per refresh)


GPT suggested a strategy of:

User load HF space: get id from cache
Admin can refresh id to cache with admin password set in secret.

May try it on my test space first

Acceleration Consortium org

Maybe worth implementing something related to session state? https://www.gradio.app/guides/state-in-blocks

Thoughts?

Sign up or log in to comment