ytmusicapi.auth package
***********************


Subpackages
===========

* ytmusicapi.auth.oauth package

  * Submodules

  * ytmusicapi.auth.oauth.credentials module

    * "Credentials"

      * "Credentials.client_id"

      * "Credentials.client_secret"

      * "Credentials.get_code()"

      * "Credentials.refresh_token()"

      * "Credentials.token_from_code()"

    * "OAuthCredentials"

      * "OAuthCredentials.client_id"

      * "OAuthCredentials.client_secret"

      * "OAuthCredentials.get_code()"

      * "OAuthCredentials.refresh_token()"

      * "OAuthCredentials.token_from_code()"

  * ytmusicapi.auth.oauth.exceptions module

    * "BadOAuthClient"

    * "UnauthorizedOAuthClient"

  * ytmusicapi.auth.oauth.models module

    * "AuthCodeDict"

      * "AuthCodeDict.device_code"

      * "AuthCodeDict.expires_in"

      * "AuthCodeDict.interval"

      * "AuthCodeDict.user_code"

      * "AuthCodeDict.verification_url"

    * "BaseTokenDict"

      * "BaseTokenDict.access_token"

      * "BaseTokenDict.expires_in"

      * "BaseTokenDict.scope"

      * "BaseTokenDict.token_type"

    * "RefreshableTokenDict"

      * "RefreshableTokenDict.expires_at"

      * "RefreshableTokenDict.refresh_token"

      * "RefreshableTokenDict.refresh_token_expires_in"

  * ytmusicapi.auth.oauth.token module

    * "OAuthToken"

      * "OAuthToken.from_json()"

      * "OAuthToken.is_expiring"

      * "OAuthToken.is_oauth()"

      * "OAuthToken.update()"

    * "RefreshingToken"

      * "RefreshingToken.credentials"

      * "RefreshingToken.local_cache"

      * "RefreshingToken.prompt_for_token()"

      * "RefreshingToken.store_token()"

    * "Token"

      * "Token.access_token"

      * "Token.as_auth()"

      * "Token.as_dict()"

      * "Token.as_json()"

      * "Token.expires_at"

      * "Token.expires_in"

      * "Token.is_expiring"

      * "Token.members()"

      * "Token.refresh_token"

      * "Token.scope"

      * "Token.token_type"

  * Module contents

    * "OAuthCredentials"

      * "OAuthCredentials.client_id"

      * "OAuthCredentials.client_secret"

      * "OAuthCredentials.get_code()"

      * "OAuthCredentials.refresh_token()"

      * "OAuthCredentials.token_from_code()"

    * "OAuthToken"

      * "OAuthToken.from_json()"

      * "OAuthToken.is_expiring"

      * "OAuthToken.is_oauth()"

      * "OAuthToken.update()"

    * "RefreshingToken"

      * "RefreshingToken.credentials"

      * "RefreshingToken.local_cache"

      * "RefreshingToken.prompt_for_token()"

      * "RefreshingToken.store_token()"


Submodules
==========


ytmusicapi.auth.auth_parse module
=================================

ytmusicapi.auth.auth_parse.determine_auth_type(auth_headers: CaseInsensitiveDict[str]) -> AuthType

   Determine the type of auth based on auth headers.

   Parameters:
      **auth_headers** ("CaseInsensitiveDict"["str"]) -- auth headers
      dict

   Return type:
      "AuthType"

   Returns:
      AuthType enum

ytmusicapi.auth.auth_parse.parse_auth_str(auth: str | dict[str, Any]) -> tuple[CaseInsensitiveDict[str], Path | None]

   Parameters:
      **auth** ("str" | "dict"["str", "Any"]) -- user-provided auth
      string or dict

   Return type:
      "tuple"["CaseInsensitiveDict"["str"], "Path" | "None"]

   Returns:
      parsed header dict based on auth, optionally path to file if it
      auth was a path to a file


ytmusicapi.auth.browser module
==============================

ytmusicapi.auth.browser.is_browser(headers: CaseInsensitiveDict[str]) -> bool

   Return type:
      "bool"

ytmusicapi.auth.browser.setup_browser(filepath: str | None = None, headers_raw: str | None = None) -> str

   Return type:
      "str"


ytmusicapi.auth.types module
============================

enum representing types of authentication supported by this library

class ytmusicapi.auth.types.AuthType(*values)

   Bases: "int", "Enum"

   enum representing types of authentication supported by this library

   BROWSER = 2

   OAUTH_CUSTOM_CLIENT = 3

      YTM instance is using a non-default OAuth client (id & secret)

   OAUTH_CUSTOM_FULL = 4

      allows fully formed OAuth headers to ignore browser auth refresh
      flow

   UNAUTHORIZED = 1


Module contents
===============
