feat(Innertube/HTTPClient): Add BotGuardManager and improve one-time context in HTTPClient - #1248
feat(Innertube/HTTPClient): Add BotGuardManager and improve one-time context in HTTPClient#1248Illusion137 wants to merge 46 commits into
BotGuardManager and improve one-time context in HTTPClient#1248Conversation
…otentially binds) + updating HTTPClient to support raw page fetches
…use in attestation challenges
…ke `client` and `eats`
…d proper typing for it in `Actions`
Feat(better context)
…sion, but with an additional `decodeUnicodeEscapes` for decoding stuff like `ytAtN.R.challenge`
BotGuardManager and improve one-time context in HTTPClientBotGuardManager and improve one-time context in HTTPClient
|
Is |
|
I'm not sure if Update:
from this, even if it seems useless, the fact that it seems fairly tied to attestation makes me think it'd be a good idea to keep it just in case. |
|
Although if we do decide to keep it, should we continue to let the users manage |
…ager take in a required`content_binding` instead + update the log function to auto support new system
fix(BotGuard): make challenge fetching use new `ChallengeFetchingArgs` instead of `ChallengeSolverArgs`
…o generate `context.user.delegationContext`
…ed by the session
…TOR_STUDIO_ACTION`
…Challenge` args and refactored `client` to be of type `InnerTubeClient`
… add a function to solve the studio session process: `studioSessionToken`
…ResponseData` + rework `studioSessionToken`
|
So, a little bit of research and changes...
Notes
Overall I think it looks quite a bit more polished and complete, but I'll likely have to give it a couple of more lookovers... |
Both of my PR drafts #1244 and #1231, were both in need of a proper
BotGuardManagerand a way to set one-time-context for manyYouTube Studio Webrelated things likeeats. This PR hopefully removes the two different poor systems that I wrote previously with a better and cleaner interface.Noteable Features
BotGuardManagergetChallenge()gets a BotGuard challenge (either api or page based) and handles caching within theBotGuardManagerinstance.run()gets a BotGuard challenge and solves it using a generic BotGuardSolver interface; has support for both raw attestation data andRunAttestationCommandlog()many attestation operations simply require/att/log, so this just callsrun()and properly sends over thewebResponseand suchytcfgfor challenges that may need it since fromhttps://github.com/LuanRT/BgUtils/pull/44, some challenges are binded toytcfg.EVENT_IDone-time-contextinActionsandHTTPClientthere is now a arg calledone_time_contextwhich is a partial ofContext, which is used to set some context params for just a single call without modifying the session.Testing
Added some commented out tests to
main.test.tsthat tests:ENGAGEMENT_TYPE_UNBOUNDchallenge with aeacr_tokensince, based on theatn_page_url, is doesn't return a challenge, but rather just aeacr_token