Interface PoTokenProvider


public interface PoTokenProvider
Interface to provide poTokens to YouTube player requests.

On some major clients, YouTube requires that the integrity of the device passes some checks to allow playback.

These checks involve running codes to verify the integrity and using their result to generate one or multiple poToken(s) (which stands for proof of origin token(s)).

These tokens may have a role in triggering the sign in requirement.

If an implementation does not want to return a poToken for a specific client, it must return null.

Implementations of this interface are expected to be thread-safe, as they may be accessed by multiple threads.

  • Method Details

    • getWebClientPoToken

      @Nullable PoTokenResult getWebClientPoToken(String videoId)
      Get a PoTokenResult specific to the desktop website, a.k.a. the WEB InnerTube client.

      To be generated and valid, poTokens from this client must be generated using Google's BotGuard machine, which requires a JavaScript engine with a good DOM implementation. They must be added to adaptive/DASH streaming URLs with the pot parameter.

      Note that YouTube desktop website generates two poTokens: - one for the player requests poTokens, using the videoId as the minter value; - one for the streaming URLs, using a visitor data for logged-out users as the minter value.

      Returns:
      a PoTokenResult specific to the WEB InnerTube client or null if it cannot get one