1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Uploading to youtube's specific channel?

Discussion in 'C, C++, C#' started by fancyfanta, Nov 13, 2014.

  1. fancyfanta

    fancyfanta Newbie

    Joined:
    Oct 14, 2014
    Messages:
    40
    Likes Received:
    6
    Occupation:
    Software Architect
    I'm trying to upload videos to Youtube. Successfully uploaded videos to account's channel. After that I created new channel with name "Deneme1". And I tried to upload to that channel with api; but uploaded to main.
    public static string UploadVideo(string FilePath, string Title, string Description)
    {
    YouTubeRequestSettings settings;
    YouTubeRequest request;
    string devkey = "api key";
    string username = "mail";
    string password = "password";
    settings = new YouTubeRequestSettings("Deneme1", devkey, username, password) { Timeout = 10000000 };
    request = new YouTubeRequest(settings);

    Video newVideo = new Video();
    newVideo.Title = Title;
    newVideo.Description = Description;
    newVideo.Private = true;
    newVideo.YouTubeEntry.Private = false;
    newVideo.Keywords = "asd";
    newVideo.Tags.Add(new MediaCategory("Sports", YouTubeNameTable.CategorySchema));
    newVideo.YouTubeEntry.MediaSource = new MediaFileSource(FilePath, "video/flv");
    Video createdVideo = request.Upload(newVideo);
    return createdVideo.VideoId;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
    try
    {
    string videopath, videotitle, videodesc;
    videopath = "filepath";
    videotitle = "test title";
    videodesc = "test description";
    UploadVideo(videopath, videotitle, videodesc);
    }
    catch (Exception exception)
    {
    Response.Write("Upload failed: " + exception.Message);
    }
     
  2. LisaHamilton

    LisaHamilton Regular Member

    Joined:
    Oct 30, 2014
    Messages:
    306
    Likes Received:
    17
    Occupation:
    Web Content Writer/Blogger and SEO Expert
    Location:
    Hong Kong
    Home Page:
    I don't have very good knowledge about codding... but trying to start a YouTube Chanel is there any tip for me...?
     
  3. GreedHF

    GreedHF Newbie

    Joined:
    Nov 14, 2014
    Messages:
    15
    Likes Received:
    2
    Yeah, start by not going offtopic :roflmao:.
    Did you switch the devkey?