【问题标题】:Getting video upload date with Zend Gdata Youtube API使用 Zend Gdata Youtube API 获取视频上传日期
【发布时间】:2013-04-18 07:04:24
【问题描述】:

我正在尝试获取特定用户的视频列表,其中包含视频的所有详细信息(标题、描述、日期、标签...) 我几乎可以得到我需要的一切,但不知道如何获得上传日期。 我尝试使用 getVideoRecorded() 和 getRecorded(),但都没有返回任何内容。

我似乎无法在 Google 上找到与此相关的任何内容,我只能找到告诉我必须使用 getVideoRecorded 或 getRecorded 的类引用,但仅此而已。

我做错了吗?如何获取上传日期?

当前代码:

$authenticationURL= 'https://www.google.com/accounts/ClientLogin';
$httpClient = 
  Zend_Gdata_ClientLogin::getHttpClient(
              $username = $yt_username,
              $password = $yt_password,
              $service = 'youtube',
              $client = null,
              $source = '', // a short string identifying your application
              $loginToken = null,
              $loginCaptcha = null,
              $authenticationURL);
$yt = new Zend_Gdata_YouTube($httpClient);
$feed = $yt->getUserUploads($yt_username);
foreach($feed as $item)
                {
                    echo "<div>";
                    echo "<h4>title: " . $item->getVideoTitle() . "</h4>";
                    echo "<p>id: " . $item->getVideoId() . " | ";
                    echo "upload date: " . $item->getVideoRecorded() . "</p>";
                    echo "<p>description: " . $item->getVideoDescription() . "</p>";
                    echo "<p>tags: " . implode(", ", $item->getVideoTags()) . "</p>";
                    echo "</div>";
                    echo "<hr>";
                }

【问题讨论】:

    标签: php youtube youtube-api zend-gdata


    【解决方案1】:

    您可以尝试从以下 xml 中提取 或 标签:

    http://gdata.youtube.com/feeds/api/videos/{$videoId}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-16
      • 1970-01-01
      • 2019-05-17
      • 1970-01-01
      • 1970-01-01
      • 2021-09-09
      • 2012-05-06
      • 2012-06-09
      相关资源
      最近更新 更多