GoogleApiClient#

class langchain_community.document_loaders.youtube.GoogleApiClient(credentials_path: Path = PosixPath('/home/runner/.credentials/credentials.json'), service_account_path: Path = PosixPath('/home/runner/.credentials/credentials.json'), token_path: Path = PosixPath('/home/runner/.credentials/token.json'))[source]#

Generic Google API Client.

To use, you should have the google_auth_oauthlib,youtube_transcript_api,google python package installed. As the google api expects credentials you need to set up a google account and register your Service. “https://developers.google.com/docs/api/quickstart/python

Security Note: Note that parsing of the transcripts relies on the standard

xml library but the input is viewed as trusted in this case.

Example

from langchain_community.document_loaders import GoogleApiClient
google_api_client = GoogleApiClient(
    service_account_path=Path("path_to_your_sec_file.json")
)

Attributes

credentials_path

service_account_path

token_path

Methods

__init__([credentials_path, ...])

validate_channel_or_videoIds_is_set(values)

Validate that either folder_id or document_ids is set, but not both.

Parameters:
  • credentials_path (Path) –

  • service_account_path (Path) –

  • token_path (Path) –

__init__(credentials_path: Path = PosixPath('/home/runner/.credentials/credentials.json'), service_account_path: Path = PosixPath('/home/runner/.credentials/credentials.json'), token_path: Path = PosixPath('/home/runner/.credentials/token.json')) None#
Parameters:
  • credentials_path (Path) –

  • service_account_path (Path) –

  • token_path (Path) –

Return type:

None

classmethod validate_channel_or_videoIds_is_set(values: Dict[str, Any]) Dict[str, Any][source]#

Validate that either folder_id or document_ids is set, but not both.

Parameters:

values (Dict[str, Any]) –

Return type:

Dict[str, Any]

Examples using GoogleApiClient