【问题标题】:How to change the request URL from Zend_Gdata_Youtube to actually work on API v3?如何将请求 URL 从 Zend_Gdata_Youtube 更改为实际在 API v3 上工作?
【发布时间】:2015-09-04 13:09:06
【问题描述】:

我认为这可能听起来很奇怪,但我有一个使用 Zend 框架连接到 Youtube 以前的 API 的整个 Web 应用程序。问题是我有一堆代码,很多东西都在处理这个代码,而且 Zend 似乎没有更新它,所以我可以使用 API 3。

我发现了错误,这是因为文件 youtube.php 正在使用这个 URL:

const USER_URI = 'https://gdata.youtube.com/feeds/api/users';
    const VIDEO_URI = 'https://gdata.youtube.com/feeds/api/videos';
    const PLAYLIST_REL = 'http://gdata.youtube.com/schemas/2007#playlist';
    const USER_UPLOADS_REL = 'http://gdata.youtube.com/schemas/2007#user.uploads';
    const USER_PLAYLISTS_REL = 'http://gdata.youtube.com/schemas/2007#user.playlists';
    const USER_SUBSCRIPTIONS_REL = 'http://gdata.youtube.com/schemas/2007#user.subscriptions';
    const USER_CONTACTS_REL = 'http://gdata.youtube.com/schemas/2007#user.contacts';
    const USER_FAVORITES_REL = 'http://gdata.youtube.com/schemas/2007#user.favorites';
    const VIDEO_RESPONSES_REL = 'http://gdata.youtube.com/schemas/2007#video.responses';
    const VIDEO_RATINGS_REL = 'http://gdata.youtube.com/schemas/2007#video.ratings';
    const VIDEO_COMPLAINTS_REL = 'http://gdata.youtube.com/schemas/2007#video.complaints';
    const ACTIVITY_FEED_URI = 'https://gdata.youtube.com/feeds/api/events';
    const FRIEND_ACTIVITY_FEED_URI =
        'https://gdata.youtube.com/feeds/api/users/default/friendsactivity';

我认为这应该更改为新的请求 URL,但我认为这发生在整个代码中,我不知道如何更改,所以我可以实际使用新的 API。

我得到的错误是:

PHP 致命错误:未捕获的异常 'Zend_Gdata_App_HttpException' 带有消息 'Expected response code 200, got 410 C: 中不再可用'...

【问题讨论】:

标签: php api zend-framework youtube gdata


【解决方案1】:

请参阅repo's page 上的自述文件:

此组件未维护。如果您需要 API 访问 Google api,请考虑使用 https://code.google.com/p/google-api-php-client/

【讨论】:

    猜你喜欢
    • 2016-01-18
    • 2021-11-15
    • 2021-05-18
    • 2020-08-05
    • 2019-06-02
    • 1970-01-01
    • 2020-11-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多