【问题标题】:How can I upload a video to YouYube using the Youtube API in C#?如何使用 C# 中的 Youtube API 将视频上传到 YouTube?
【发布时间】:2011-06-13 10:40:09
【问题描述】:

下面的代码失败了?可能是什么问题?

 YouTubeRequestSettings settings = new YouTubeRequestSettings("whatwill come here ?",
                "my api key",
                "my youtube login email", "my youtube login password");
        YouTubeRequest request = new YouTubeRequest(settings);

Video newVideo = new Video();

newVideo.Title = "test 1";
            newVideo.Tags.Add(new MediaCategory("Gaming", YouTubeNameTable.CategorySchema));
            newVideo.Keywords = "test 1 , test 2";

            newVideo.Description = "test 3 test 4";
            newVideo.YouTubeEntry.Private = false;
            newVideo.Tags.Add(new MediaCategory("tag 1, tag 2",
              YouTubeNameTable.DeveloperTagSchema));

            newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);


            newVideo.YouTubeEntry.MediaSource = new MediaFileSource("C:\\test.avi", "video/quicktime");         



                Video createdVideo = request.Upload(newVideo);

我解决了这个问题。这是我的类别:类别必须是 Games 而不是 Gaming

【问题讨论】:

  • 我看到了。但它没有解释如何使用 youtube api。我如何整合它?我下载并安装了 YouTube SDK (1.7.0.1).msi
  • 嗨 MonsterMMORPG 我有关于在 YouTube 上上传视频的教程或代码吗?我被 Client_secret.json 文件卡住了。您的指导将不胜感激...请帮助我...

标签: c# video upload youtube youtube-api


【解决方案1】:

问题在于您的“游戏”类别。将您的 MediaCategory 构造函数修改为以下内容:

newVideo.Tags.Add(new MediaCategory("Games", YouTubeNameTable.CategorySchema));

它应该适合你。

【讨论】:

    猜你喜欢
    • 2011-05-13
    • 1970-01-01
    • 2012-12-23
    • 2017-05-16
    • 2014-04-10
    • 2017-02-27
    • 2013-12-12
    • 2017-04-13
    • 2021-07-29
    相关资源
    最近更新 更多