0

YouTubeServiceを正しく初期化しました。プレイリストエントリを移動/削除/名前変更できますが、プレイリストを削除しようとすると、役に立たない例外が発生します。

_service = None

def get_service():
    global _service

    if _service is None:
        _service = YouTubeService()
        gdata.alt.appengine.run_on_appengine(_service)
        _service.developer_key = settings.YTMANAGER_DEVELOPER_KEY

        if 'token' in get_request().session:
            _service.SetAuthSubToken(get_request().session['token'])

    return _service

def test(request):
    get_service().DeletePlaylist('http://gdata.youtube.com/feeds/api/playlists/921AC6352FE6931F')
    return HttpResponse('ok')

例外:

Exception Type:  RequestError
Exception Value: {'status': 400, 'body': 'Invalid request URI', 'reason': ''}
Exception Location: \gdata\service.py in Delete, line 1454
4

1 に答える 1

0

ドキュメント(http://code.google.com/apis/youtube/1.0/developers_guide_python.html#DeletePlaylists)が古くなっているか、これはバグですが、DeletePlaylistには「完全な」リンクが必要です。

http://gdata.youtube.com/feeds/api/users/username/playlists/921AC6352FE6931F

GetYouTubePlaylistVideoFeedメソッドは、max-resultsパラメーターを使用するために「短い」リンクを必要とするため、次のようになります。

http://gdata.youtube.com/feeds/api/playlists/921AC6352FE6931F
于 2010-09-22T19:12:17.420 に答える