Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Youtube API to upload video from website

Tags:

youtube-api

I am working on a website, where users can register themselves on the front-end and can access their profile account on the front-end as well.

There is an option within their user panel frow which they can upload a video. But the problem that arises is that if we try to use a simple HTML video tag to show video, it doesn't support all formats of video.

Also, the client has a special request to have an upload option in such a way that it uploads a .mov file of iPhone which a user can make using their iPhone video recorder and upload it directly.

For that, we thought to use Youtube API that allows videos to be played in almost any browser and any mobile phone.

But, I am not very clear if Youtube API can achieve what I want to happen:

I want that when a user logs into their user panel and tries to upload their .mov or any other format of the video, then via the Youtube API, the video they upload gets transferred to our Youtube account without letting the user know that their video is uploaded to Youtube.

like image 820
ROHIT PANDEY Avatar asked Jan 29 '14 06:01

ROHIT PANDEY


People also ask

Can you upload videos with YouTube API?

Stay organized with collections Save and categorize content based on your preferences. This guide provides and explains a Python script that uploads a YouTube video using the YouTube Data API. The code uses the Google APIs Client Library for Python.


1 Answers

Yes, you can use Youtube API to let your users upload videos, create and manage playlists, and more from your website, I am not sure if they will or won't notice it's getting uploaded on Youtube.

What you need:

You need a Google Account to access the Google Developers Console,
request an API key and register your application. Create a project in
the Google Developers Console and obtain authorization credentials so
your application can submit API requests. After creating your project,
make sure the YouTube Data API is one of the services that your
application is registered to use: Go to the Developers Console and
select the project that you just registered. Open the API Library in
the Google Developers Console. If prompted, select a project or create
a new one. In the list of APIs, make sure the status is ON for the
YouTube Data API v3. If your application will use any API methods that
require user authorization, read the authentication guide to learn how
to implement OAuth 2.0 authorization. Select a client library to
simplify your API implementation. Familiarize yourself with the core
concepts of the JSON (JavaScript Object Notation) data format. JSON is
a common, language-independent data format that provides a simple text
representation of arbitrary data structures. For more information, see
json.org.

If you need additional information visit the official documentation

like image 159
knif3r Avatar answered Oct 04 '22 01:10

knif3r