Download the PHP package craytor/youtube without Composer

On this page you can find all versions of the php package craytor/youtube. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package youtube

Laravel 5 - YouTube Video Upload

Please note, that this package will only work with a single YouTube account and does not support multiple accounts.

Installation

To install, use the following to pull the package in via Composer.

Now register the Service provider in config/app.php

And also add the alias to the same file.

Configuration

You now need to publish the youtube.php config and migrations.

Now you'll want to run php artisan migrate to create the youtube_access_tokens table which as you would imagine, will contain your access tokens once you're authenticated correctly.

Obtaining your Credentials

If you haven't already, you'll need to create an application on Google's Developer Console. You then need to head into Credentials within the Console to create Server key.

You will be asked to enter your Authorised redirect URIs. When installing this package, the default redirect URI is http://laravel.dev/youtube/callback. Of course, replacing the domain (laravel.dev) with your applications domain name.

You can add multiple redirect URIs, for example you may want to add the URIs for your local, staging and production servers.

Once you are happy with everything, create the credentials and you will be provided with a Client ID and Client Secret. These now need to be added to your .env file.

Authentication

For security reasons, the routes to authorize your channel with your Laravel application for disabled by default. You will need to enable them in your config/youtube.php before doing the following.

Now your application is configured, we'll go through the inital authentication with Google. By default, the authorization route is /youtube/auth. Simply visit this URI in your application and you will be redirect to Google to authenticate your YouTube account.

Assuming you were not presented with any errors during authentication, you will be redirected back to your application root. (/).

Reviewing your Token

Previously, users of this package have reported issues with their access token(s). To ensure you have the correct token, you simply need to review the youtube_access_tokens table you migrated earlier and review the value in the access_token column.

You need to check that a refresh_token exists within this value. If this is correct, you're all set to begin uploading.

You will also want to disable the routes used for authorization as they will no longer be required since you are now autheticated. The token you just reviewed, assuming as a refresh_token will automatically be handled.

Upload a Video

To upload a video, you simply need to pass the full path to your video you wish to upload and specify your video information.

Here's an example:

The above will return the ID of the uploaded video to YouTube. (i.e dQw4w9WgXcQ)

By default, video uploads are public. If you would like to change the privacy of the upload, you can do so by passing a third parameter to the upload method.

For example, the below will upload the video as unlisted.

Custom Thumbnail

If you would like to set a custom thumbnail for for upload, you can use the withThumbnail() method via chaining.

Please note, the maxiumum filesize for the thumbnail is 2MB. Setting a thumbnail will not work if you attempt to use a thumbnail that exceeds this size.

Deleting a Video

If you would like to delete a video, which of course is uploaded to your authorized channel, you will also have the ability to delete it:

When deleting a video, it will check if exists before attempting to delete.

Questions

Should you have any questions, please feel free to submit an issue.


All versions of youtube with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/support Version ^5.4
google/apiclient Version ^2.2
nesbot/carbon Version ^1.22
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package craytor/youtube contains the following files

Loading the files please wait ....