【问题标题】:YouTube API v3 - captions upload causes HTTP 500 backend errorYouTube API v3 - 字幕上传导致 HTTP 500 后端错误
【发布时间】:2015-07-22 17:07:18
【问题描述】:

我正在使用代码示例来了解如何使用 YouTube v3 API 方法来上传 YouTube 视频字幕轨道,提供于:

https://developers.google.com/youtube/v3/code_samples/python#create_and_manage_youtube_video_caption_tracks

但是,当我使用以下命令从命令行运行它时:

python manage_captions.py --file="test.srt" --videoid='dDiL1fbAIdA' --action='upload'

test.rst的内容是:

First line of caption track: 1
00:00:23,000 --> 00:00:25,000
This text displays for two seconds starting
1 minute and 23 seconds into the video.

2
00:02:20,250 --> 00:02:23,800
This text displays from 2 minutes and 20.25 seconds after the start
of the video until 2 minutes and 23.8 seconds after the start of the video.

3
00:03:14,159 --> 00:03:22,092
This text displays beginning 3 minutes and 14.159 seconds
after the start of the video for an undefined length of time. 

我收到一个 HTTP 错误:

An HTTP error 500 occurred:
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "backendError",
    "message": "Backend Error"
   }
  ],
  "code": 500,
  "message": "Backend Error"
 }
}

对为什么会发生这种情况有任何想法吗?

【问题讨论】:

    标签: python youtube-data-api


    【解决方案1】:

    您需要将 --language='en' 添加到调用中,因为它是必填字段。

    【讨论】:

    • 默认为'en'
    【解决方案2】:

    今天再次尝试后,我能够成功上传字幕。不知道发生了什么变化,但错误并没有重复,虽然我没有改变任何东西。

    【讨论】:

      猜你喜欢
      • 2015-09-24
      • 1970-01-01
      • 2013-04-03
      • 2017-06-14
      • 1970-01-01
      • 2013-04-14
      • 1970-01-01
      • 2018-02-25
      • 2015-10-03
      相关资源
      最近更新 更多