在没有youtube api的情况下上传youtube视频

时间:2011-03-07 13:31:16

标签: asp.net upload youtube

如何在不使用asp.net的api的情况下将视频上传到Youtube? 我的要求是用户将视频上传到我们的网站,并在管理员批准后将视频上传到Youtube。我正在使用ASP.NET

3 个答案:

答案 0 :(得分:2)

答案 1 :(得分:0)

杰森我正在使用这段代码:

  Dim request As YouTubeRequest
    Dim newVideo As New Video()

    newVideo.Title = "My Test Movie"
    newVideo.Tags.Add(New MediaCategory("Autos", YouTubeNameTable.CategorySchema))
    newVideo.Keywords = "cars, funny"
    newVideo.Description = "My description"
    newVideo.YouTubeEntry.Private = False
    newVideo.Tags.Add(New MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema))

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

    newVideo.YouTubeEntry.MediaSource = New MediaFileSource("c:\\flame.avi", "video/quicktime")
    Dim createdVideo As Video = request.Upload(newVideo)

但是在哪里指定Youtube凭证和密钥?

答案 2 :(得分:0)

 Dim settings As YouTubeRequestSettings = New YouTubeRequestSettings("youtube", developerKey, username, password)

    Dim request As New YouTubeRequest(settings)
    Dim newVideo As New Video()

    newVideo.Title = "My Test Movie"
    newVideo.Tags.Add(New MediaCategory("Autos", YouTubeNameTable.CategorySchema))
    newVideo.Keywords = "cars, funny"
    newVideo.Description = "My description"
    newVideo.YouTubeEntry.Private = False
    newVideo.Tags.Add(New MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema))

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

    newVideo.YouTubeEntry.MediaSource = New MediaFileSource("c:\\drop.avi", "video/x-msvideo")
    Dim createdVideo As Video = request.Upload(newVideo)