Repository navigation
feat(youtube): hosted transcript action with a vendor-neutral provider table - #843
Open
pushkarsingh32 wants to merge 1 commit into
Open
pushkarsingh32 wants to merge 1 commit into
pushkarsingh32 wants to merge 1 commit into
Conversation
A separate, explicit action that reads the transcript from a hosted transcript API the user configured. The provider fetches the captions, so nothing is requested from YouTube on this machine. It is not a fallback: a YouTube verification challenge stays a final error (PLATFORM_BLOCKED), and the action never switches providers on its own. Setup mirrors the Whisper keys: agent-reach configure transcript-api-key, plus an optional transcript-api-provider. Providers are one entry each in agent_reach/hosted_transcript.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文摘要: 为 YouTube 增加一个单独的
transcript动作:读取用户自己配置的托管转录 API(需要 Key),由服务商取字幕,本机不向 YouTube 发请求。它不是 yt-dlp 失败后的自动回退(PLATFORM_BLOCKED仍是最终错误),也不会在多个服务之间自动切换。相关:#774。Refs #774.
What it adds
agent-reach youtube transcript <link|id> [--lang en]returns the transcript from a hosted transcript API the user configured. The provider fetches the captions, so nothing is requested from YouTube on this machine. That is the case #774 and #566 describe: on a VPS every local route hits the bot check together.PLATFORM_BLOCKEDstays a final error with its "do not switch backends or retry" hint. The new action only runs when an agent or the user picks it, the same waytranscribeonly runs when picked.PROVIDERSinagent_reach/hosted_transcript.py(endpoint, how to build the query, how to read the reply). With one provider in the table it is used automatically; with several,agent-reach configure transcript-api-provider <name>is required and the NEED_SETUP hint lists the valid names. No provider is a hardcoded default, and there is no silent switching.agent-reach configure transcript-api-key, stored likegroq-key. It is sent only as anAuthorization: Bearerheader, never in the URL, and never appears in an error message or hint (there is a test for each).NEED_SETUPwith a hint specific to that case, 404 isNOT_FOUND, 429 isRATE_LIMITED, timeouts areTIMEOUT, anything else isUPSTREAM_BROKEN. The provider's own message is passed through, capped at 200 characters.requestsis already used bytranscribe.py). The endpoint is a constant in the table, so a user-supplied URL is never fetched.Files:
hosted_transcript.py(new), thetranscriptaction inchannels/youtube.py, two keys inCONFIG_KEYSand theconfigurehelp line, the YouTube row incapabilities.md, an Unreleased entry inCHANGELOG.md.How it was tested
ruff check agent_reach testsclean,mypy agent_reachclean,pytest500 passed (Python 3.13 locally; CI covers 3.10 to 3.12).backend: hosted), a rejected key, a video id that does not exist, a non-YouTube link, and an unknown provider each return the expected code. The only provider in the table was exercised live; a second provider is covered by the injected-HTTP tests only.Relation to #800
#800 addresses the same issue with an Apify-only registry. It was written against the pre-1.6 layout: it is now 64 commits behind main and conflicts in six files (and
references/video.mdno longer exists), so it cannot merge as is. This PR is the same vendor-neutral idea on the 1.6 action and backend contract. If you prefer #800's registry shape, a second provider here is one entry inPROVIDERS, so the two can be combined. I am happy to adapt this either way.Disclosure
I run getyoutubetranscript.com, the only provider in the table at the moment, so please weigh this accordingly. If you would rather ship the table empty and let each service add its own entry, I will remove it.