[YouTube API] "Die Anfrage wurde abgebrochen."



  • Hallo,

    mein Programm generiert ein Video aus einer MP3-Datei und einem Bild und soll dieses Video dann auf Youtube hochladen. 1. Teil klappt super, d.h. Video wird erstellt und lässt sich abspielen. Ich hab mir jetzt ein paar Artikel im Internet zur Youtube API angeschaut und es mal versucht. Leider kommt bei mir die Fehlermeldung "Die Anfrage wurde abgebrochen.".

    Wenn jetzt hier vielleicht jemand mal über den Code rüberschauen könnte, warum der nicht so will, wie ich das will, dann wäre das super. 👍

    Hier mal der Code:

    private static YouTubeRequestSettings settings;
    
            static void UploaderDoWork(string videoToUpload, string title, string description, string tags)
            {
                settings.Timeout = -1;
                var request = new YouTubeRequest(settings);
                var newVideo = new Video { Title = title };
                newVideo.Tags.Add(new MediaCategory(tags, YouTubeNameTable.CategorySchema));
                newVideo.Description = description;
                newVideo.YouTubeEntry.Private = false;
                newVideo.YouTubeEntry.MediaSource = new MediaFileSource(videoToUpload, "video/x-ms-wmv");
                try
                {
                    request.Upload(newVideo);
                }
                catch (Exception exception)
                {
                    MessageBox.Show("Upload failed: " + exception.Message); //hier wird mein scheitern dokumentiert und ausgegeben
                }
            }
    
    		public string YoutubeUploadVideo(string userName, string pwd, string videoToUpload, string title, string description, string tags)
    		{
    			string error = "";
    
                settings = new YouTubeRequestSettings("uploader", "devkey", userName, pwd);
                UploaderDoWork(videoToUpload, title, description, tags);
                MessageBox.Show("Initiated upload process...");
    
    			return error;
    		}
    

    aufgerufen durch

    m_ErrorStore = m_Helper.YoutubeUploadVideo("email", "pwd", speicherort, video_titel, Video_beschreibung, tags);
    

    Danke schon mal! 👍 👍



  • Mhhhhhhhhhhhhhhhhhhhhm ich glaube du machst irgendwas falsch.


Anmelden zum Antworten