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.access_token"

      * "RefreshableTokenDict.expires_at"

      * "RefreshableTokenDict.expires_in"

      * "RefreshableTokenDict.refresh_token"

      * "RefreshableTokenDict.scope"

      * "RefreshableTokenDict.token_type"

  * 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.access_token"

      * "RefreshingToken.credentials"

      * "RefreshingToken.local_cache"

      * "RefreshingToken.prompt_for_token()"

      * "RefreshingToken.refresh_token"

      * "RefreshingToken.scope"

      * "RefreshingToken.store_token()"

      * "RefreshingToken.token_type"


Submodules
==========


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

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

   Determine the type of auth based on auth headers.

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

   Return type:
      "AuthType"

   Returns:
      AuthType enum

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

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

   Return type:
      "tuple"["CaseInsensitiveDict", "Optional"["Path"]]

   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) -> 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
===============
