【问题标题】:Batch deleting videos using YouTube API and HTTpWebRequest使用 YouTube API 和 HTTpWebRequest 批量删除视频
【发布时间】:2012-12-24 22:41:38
【问题描述】:

我在这上面花了将近 10 个小时,但仍然没有运气,只有错误。

我正在尝试使用 c# .net 中的 YouTube API 和 HttpWebRequest 批量删除 2 个视频(我没有使用默认的 api dll)

我将请求(使用 POST)发送到: http://gdata.youtube.com/feeds/api/users/default/uploads/batch?v=2

这是我发送的 xml 请求:

<feed xmlns='http://www.w3.org/2005/Atom' 
 xmlns:media='http://search.yahoo.com/mrss/' 
 xmlns:batch='http://schemas.google.com/gdata/batch' 
 xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<entry>
<batch:operation type="delete"/>
<id>http://gdata.youtube.com/feeds/api/users/default/uploads/Fe-Wzz4thKk</id>
</entry>
</feed>

我收到错误:无效的条目 Id/Uri

我也尝试只发送视频的 ID,但仍然没有成功,只有错误。 我该怎么办?这真的很令人沮丧,因为我找不到任何删除视频(不是播放列表)的示例。

希望有人可以提供帮助。

谢谢! 弗拉德

编辑:

我还尝试将 POST 数据发送到:

http://gdata.youtube.com/feeds/api/videos/batch?v=2

还有数据:

 <feed xmlns='http://www.w3.org/2005/Atom' 
 xmlns:media='http://search.yahoo.com/mrss/' 
 xmlns:batch='http://schemas.google.com/gdata/batch' 
 xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<entry>
<batch:operation type="delete"/>
<id>http://gdata.youtube.com/feeds/api/videos/Fe-Wzz4thKk</id>
</entry>
</feed>

这个错误是: 此供稿是只读的

我用优秀的用户记录了它(我测试了上传视频和其他东西并且它有效)。

【问题讨论】:

    标签: c# youtube youtube-api


    【解决方案1】:

    我想让你们现在我破解了这个。答案很简单。

    首先,请求是:

    http://gdata.youtube.com/feeds/api/users/ACCOUNT_CHANNEL_NAME/uploads/batch?v=2
    

    而不是:

    http://gdata.youtube.com/feeds/api/users/default/uploads/batch?v=2
    

    因此您不能使用“默认”关键字。我认为这是唯一不起作用的地方。

    此外,每个元素的 .. 应如下所示:

    <id>http://gdata.youtube.com/feeds/api/users/ACCOUNT_CHANNEL_NAME/uploads/VIDEO_ID</id>
    

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-16
      • 2018-11-30
      • 2015-01-03
      • 2015-12-11
      • 1970-01-01
      • 2012-12-21
      • 2012-01-02
      • 2011-10-06
      相关资源
      最近更新 更多