1

関連ドキュメントはこちらにあります: https://developers.google.com/youtube/2.0/developers_guide_protocol_captions#Create_Caption_Track

次のことを試しましたが、難解な「urllib2.HTTPError: HTTP エラー 401: 不明な認証ヘッダー」を受け取るだけです。

import gdata.youtube, gdata.youtube.service, urllib2
yt_service = gdata.youtube.service.YouTubeService()
yt_service.ClientLogin("username@gmail.com","password")
yt_service.ProgrammaticLogin()
auth = yt_service.current_token.get_token_string()
url = "https://gdata.youtube.com/feeds/api/videos/VIDEO_ID/captions"
req = urllib2.Request(url, "Transcript", {'Content-Type': 'application/vnd.youtube.timedtext; charset=UTF-8', 'Content-Language:': 'en', 'Authorization': auth})
f = urllib2.urlopen(req)
4

1 に答える 1