python - Python Youtube 视频上传文件
问题描述
无法找出视频的定义方式
video = "/Users/mac/Desktop/Sam/video.avi"
我想运行并安装此代码
import os
import google_auth_oauthlib
import googleapiclient.discovery
import googleapiclient.errors
scopes = ["https://www.googleapis.com/auth/youtube.readonly"]
def main():
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1"
api_service_name = "youtube"
api_version = "v3"
client_secrets_file = "client_secret.json"
# Get credentials and create an API client
flow = google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file(
client_secrets_file, scopes)
credentials = flow.run_console()
youtube = googleapiclient.discovery.build(
api_service_name, api_version, credentials=credentials)
request = youtube.liveBroadcasts().list(
)
response = request.execute()
print(response)
解决方案
推荐阅读
- stripe-payments - 如何通过 Stripe redirectToCheckout 函数传递元数据
- suitescript - 如何从带有某些字段来源的按钮导航到自定义记录?(suitescript 2.0)
- c++ - 为什么 QDialogButtonBox 标签的语言在设计和执行之间会发生变化?
- python - 有没有办法使用消息 ID 编辑特定消息。不和谐
- php - 通过 CSV 将自定义分类法导入 WooCommerce
- python - 以 10 为底的 int() 的 Django 无效文字:b'11 20:11:22'
- scala - 如何将一个或多个本地 .jar 文件中的类导入 Spark/Scala Notebook?
- python - 如何确保延迟等待 asyncio.wait(...) 的协程?
- java - 您将如何为采用 FileInputStream 的方法制作测试用例?
- vb6 - 将万亿数字转换为二进制