搜索列表结果null prevPageToken

时间:2017-09-11 09:56:34

标签: youtube-api youtube-data-api

我尝试使用搜索功能从我的频道获取视频。响应仅包含nextPageToken,但不包括prevPageTokenprevPageToken始终为空,即使我使用nextPageToken列出其他网页也是如此。我使用了来自Google Oauth的access_token param。

我的要求:

  $searchResponse = $youtube->search->listSearch('snippet', array(
    'forMine' => 'true',
    'order' => 'date',
    'pageToken' => $pageToken,
    'type'=>'video',
    'maxResults' => '10',
    'q' => $searchQuery,
  ));

结果:

Google_Service_YouTube_SearchListResponse Object
(
    [collection_key:protected] => items
    [etag] => "XXX"
    [eventId] => 
    [itemsType:protected] => Google_Service_YouTube_SearchResult
    [itemsDataType:protected] => array
    [kind] => youtube#searchListResponse
    [nextPageToken] => Cib3-ZrgSf____9uWHdEYVNIVnlOVQD_Af_-blh3RGFTSFZ5TlUAARAPIbmtEhE6-iWlOQAAAAC2H2UGSAFQAFoLCdIYcGeU2-YsEAJgyOjNygE=
    [pageInfoType:protected] => Google_Service_YouTube_PageInfo
    [pageInfoDataType:protected] => 
    [prevPageToken] => 
    [regionCode] => 
    [tokenPaginationType:protected] => Google_Service_YouTube_TokenPagination
    [tokenPaginationDataType:protected] => 
    [visitorId] => 
    [internal_gapi_mappings:protected] => Array
        (
        )

    [modelData:protected] => Array
        (
        )

    [processed:protected] => Array
        (
        )

    [pageInfo] => Google_Service_YouTube_PageInfo Object
        (
            [resultsPerPage] => 5
            [totalResults] => 55
            [internal_gapi_mappings:protected] => Array
                (
                )

            [modelData:protected] => Array
                (
                )

            [processed:protected] => Array
                (
                )

        )

感谢您的想法! 彼得

UPDATE 仅当设置了参数forMine时才会出现此问题。但我只需要显示我的视频......

0 个答案:

没有答案