我試圖更新使用YouTube API的入口被調用。這是我的錯誤我與掙扎:蟒蛇類型錯誤:不受約束的方法UpdateVideoEntry()必須與YouTubeService例如
Traceback (most recent call last): File "", line 1, in updated_entry = gdata.youtube.service.YouTubeService.UpdateVideoEntry(YTVentry.id) TypeError: unbound method UpdateVideoEntry() must be called with YouTubeService instance as first argument (got NoneType instance instead)
這裏是我的代碼:
import gdata.youtube
import gdata.youtube.service
import gdata.youtube.data
client = gdata.youtube.service.YouTubeService()
...
videos_feed = client.GetYouTubeVideoFeed(uri)
for entry in videos_feed.entry:
print entry.title.text
YTentry = entry._GDataEntry__GetId
YTVentry = gdata.youtube.YouTubeVideoEntry(YTentry)
YTVentry.media.title = '09.11.2012 Hold me close'
YTVentry.media.description = '09.11.2012 : Hold me close section'
updated_entry = gdata.youtube.service.YouTubeService.UpdateVideoEntry(YTVentry.id)
按照谷歌的YouTube GDATA文檔:
To update video meta-data, simply update the YouTubeVideoEntry object and then use the YouTubeService objects' UpdateVideoEntry method. This method takes as a parameter a YouTubeVideoEntry that contains updated meta-data.
在此先感謝。