0

I have Java based website. I would like users to log into my website and then upload videos to youtube using my youtube account. Users should not be required to have their own youtube account since videos will be uploaded using my youtube account.

Does youtube support this scenario? If so, is there a sample code that shows me how to do this in Java?

I have used UploadVideo.java sample provided by google (https://developers.google.com/youtube/v3/code_samples/java#upload_a_video), but it requires users to log into youtube account using their id and password. That is not my use case.

  • This is question is about using youtube Java api to address a specific use case. – user2225005 Mar 14 '15 at 20:10
  • My main question is about how to upload videos using youtube Java API. The first question is to ensure that the solution suggested is legal. I don't want to do anything that will infringe upon youtube's policies. Your first comment about "off-topic question" does not seem to me a right assessment as my question is regarding programming API and not about youtube application. – user2225005 Mar 14 '15 at 21:02

3 Answers3

0

Please study the terms and conditions of the Youtube service ; I think they do not allow this:

https://www.youtube.com/static?gl=GB&template=terms

  1. YouTube accounts 4.1 In order to access some features of the Website or other elements of the Service, you will have to create a YouTube account. When creating your account, you must provide accurate and complete information. It is important that you must keep your YouTube account password secure and confidential.

4.2 You must notify YouTube immediately of any breach of security or unauthorised use of your YouTube account that you become aware of.

4.3 You agree that you will be solely responsible (to YouTube, and to others) for all activity that occurs under your YouTube account.

and

5.1.L: you agree not to access Content or any reason other than your personal, non-commercial use solely as intended through and permitted by the normal functionality of the Service, and solely for Streaming. "Streaming" means a contemporaneous digital transmission of the material by YouTube via the Internet to a user operated Internet enabled device in such a manner that the data is intended for real-time viewing and not intended to be downloaded (either permanently or temporarily), copied, stored, or redistributed by the user.

DiZzZz
  • 621
  • 3
  • 12
  • The terms you have quoted do not say anything about the use case I have described. My code is compliant with these requirements. – user2225005 Mar 14 '15 at 19:23
0

You can not let other people use your YouTube account/channel. The way to do is using YouTube Direct Lite

You basically add a ytdl with playlist tag while uploading videos. You can check Android Client for how to do it in Java.

Ibrahim Ulukaya
  • 12,767
  • 1
  • 33
  • 36
  • YouTube Direct Lite is not the solution. It requires uses to use their own youtube account. I want to serve users through my site who may not have yourtube accounts of their own and definitely don't want them to get authenticated again. Here is a video that provides solution but i have not gotten to get it to work.https://www.youtube.com/watch?v=ADLmRWZqFOI – user2225005 Mar 20 '15 at 22:35
0

As to whether it is technically possible, yes, see https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol

The technical problem here is users will be able to delete videos too if they have your access token with full permissions. basically you need to:

load your html page with the upload interface. add to the onclick event of the upload button to send an ajax request to a script on your server which will:

  1. return the access token of your account to the client
  2. soon thereafter change the access token using the refresh token

Its still technically vulnerable though. a possible solution is to obtain the access token ONLY with the scope: https://www.googleapis.com/auth/youtube.upload

There is a very good chance it will not be vulnerable then. You should test it.