langchain_community.document_loaders.youtube.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]

通用的Google API客户端。

使用时,您应该安装了google_auth_oauthlib,youtube_transcript_api,google Python包。由于Google API期望凭证,您需要设置一个Google账号并注册您的服务。“https://developers.google.com/docs/api/quickstart/python

安全注意:请注意,字幕解析依赖于标准

xml库,但在此情况下,输入被视为可信的。

示例

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

属性

credentials_path

service_account_path

token_path

方法

__init__([credentials_path,...])

validate_channel_or_videoIds_is_set(values)

验证folder_id或document_ids是否设置,但不能同时设置。

参数
  • 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
参数
  • credentials_path (Path) –

  • service_account_path (Path) –

  • token_path (Path) –

返回类型

None

classmethod validate_channel_or_videoIds_is_set(values: Dict[str, Any]) Dict[str, Any][来源]

验证folder_id或document_ids是否设置,但不能同时设置。

参数

values (Dict[str, Any]) –

返回类型

Dict[str, Any]

使用GoogleApiClient的示例