MATLAB Answers

Can't Upload a Video to YouTube. Problem with Java Class files and​tUserCrede​ntials?

4 views (last 30 days)
I am trying to upload a video to youtube from matlab using this spiffy code:
I updated the clientID and the developerKey. But I still get the same error at service.setUserCredentials(username, password). I am using a gmail account and password, which should be a valid login. I tried several and I still can't get this code to work. Any help would be appreciated.
My feeling is that I need use a different login class (GoogleService.setUserCredentials). And call these classes instead getAuthToken, setUserCredentials in GoogleAuthTokenFactory.
Here is the error message.
Java exception occurred: Error connecting with login URI

Accepted Answer

Nathan Orloff
Nathan Orloff on 29 Feb 2012
There are several bugs with this code. The native cacerts file, developerKey, and clientID are all issues. The java archives also packaged with matlab might also be at fault. I was able to successfully upload videos to matlab by doing the following:
2) I wrote a small script to upload videos:
uploadmovie(moviefile,mystr,mycategory) % uploadmovie % uploadmovie automatically uploads a game movie to youtube.
% HISTORY: % Version 1.0, 2011-10-21.. commandline_str = ['google youtube post ' ... '--category ' mycategory.... ' --summary "' mystr '"'... ' "' movie_file '"'];
This works very well. You have to do a few things. You still need to register your account to get a clientid and developerkey from google. Then enter put the clientid in your web browser. Google will ask you to confirm that this computer can remote access your google account. There a few more steps but it is pretty intuitive. Good luck! Let me know if this was helpful.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!