Add authentication for Innertube API
Due to the recent changes in #434, I had to disable cookie based authentication, as it does not work with the Innertube API.
As authentication is required to fetch age-restricted videos, we need to find a way to add authentication to Innertube API endpoints!
Hi @jdepoix ! 👋 I’ve been exploring possible fixes for this issue and noticed that YouTube’s Innertube API accepts authenticated requests using the SAPISIDHASH header (generated from the SAPISID cookie and origin).
Would adding support for this method — by allowing users to pass their cookies and generating SAPISIDHASH dynamically — be a helpful and accepted direction for resolving authentication for age-restricted videos?
If so, I’d be happy to work on a PR. Let me know what you think!
Hi @Nishat30, I'd be happy to accept any PR that allows for authenticating with the innertube API! I don't have a preference for the method, as long as it works! 🙂