1
votes

I am developing an c# application to upload videos to youtube from my local drive to different accounts. Currently I am not using youtube API to upload the videos and I use webclient class & a google developer key to do it. I am able to upload the videos successfully to the account which is associated with the developer key. However when I use the credentials of different youtube account it's not able to upload and I get the error

"Currently authenticated user does not have write access to username myusername"

I am not sure about the cause of this error. Or is it that do I need to change any settings in the youtube account to enable the access for the application to upload videos? I assume I need to use the youtube API to do it. Are there any other methods to upload a video to different youtube account by providing the username and password with my developer key?

The problem was wit the url to upload to a comment.

Thanks.

1

1 Answers

1
votes

I have no idea what the "webclient class" you refer to means. You should be using the official YouTube API if you're programmatically interacting with YouTube.

The correct way to handle uploads is to use the username "default" when constructing your upload URL, as described at

https://developers.google.com/youtube/2.0/developers_guide_protocol_direct_uploading

This will ensure that the upload goes into the account associated with the current authorization token.

There's sample code to do this using the .NET client library available at

https://developers.google.com/youtube/2.0/developers_guide_dotnet#Direct_Upload