Download the PHP package wmrsp/bluebillywig-youtube-importer without Composer

On this page you can find all versions of the php package wmrsp/bluebillywig-youtube-importer. 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 bluebillywig-youtube-importer

Blue Billywig YouTube Importer

Composer package allowing to easily import video's from a YouTube channel into a Blue Billywig VMS publication.

NOTE

All video's must be publicly accessible.

DISCLAIMER

Youtube-dl does not use the YouTube API but scrapes web pages to collect data from the YouTube videos. This could cause youtube-dl or this package to stop working without notice.

Getting Started

Requirements

This package uses the command line software youtube-dl under the hood. This piece of software must be installed on your computer in order to use this package. To install youtube-dl, follow these instruction here.

In order to communicate with the Blue Billywig API a shared secret is required. A shared secret can be generated by going to https://*YourPublication*.bbvms.com/ovp/#/publication/api-keys (where YourPublication needs to be substituted with the name of your publication) and clicking CREATE NEW KEY.

Why youtube-dl? Why not use the YouTube API directly?

In order to communicate with the YouTube API, a special API key is required. In order to obtain such a key, one needs to create a Google account, create a project inside the Developer Console and then follow some elaborate instructions. On top of that, one is only able to make x amount of requests (for free) using this key.

Since there is a security risk involved as well as a limit to the amount of API calls that can be made using the YouTube API key, it is not feasible to include a YouTube API key with this package.

Since it is a pain to force you to create a Google account and make you jump through hoops in order to create a YouTube API key, this package uses youtube-dl instead. Yes, that does require you to install an extra piece of software on your computer but, it is easier to install and delete than a Google account. Also, youtube-dl does not only work with YouTube but with hundreds of other sites as well.

All in all, youtube-dl is the more flexible and open-ended solution to gather information from the video's on your YouTube channel.

Usage

Include bluebillywig-youtube-importer into your project

In the root of your project run the following command:

Downloading metadata

This will download a json file for each video on your YouTube channel/account. These json files contain information about the YouTube videos, amongst which the url of the particular video. In the next step this url will passed on to the Blue Billywig API so that the video may be imported into your Blue Billywig VMS account.

The order in which the video's are imported into the Blue Billywig VMS is the order in which the json files reside in the downloads folder ../vendor/wmrsp/bluebillywig-youtube-importer/downloads.

Importing into the Blue Billywig VMS

This will extract the video's url from each of the json files and pass it onto the Blue Billywig API, which in turn will import the video into the VMS. When it is all set and done the import results will be returned and saved in a log file in the logs folder ../vendor/wmrsp/bluebillywig-youtube-importer/logs.

With every successful import, the corresponding json file will be removed from the downloads folder. However, the log file will not be removed. It may be used for later reference.

Please do keep in mind that, in order to prevent overloading the Blue Billywig API, there is a timeout of 30 seconds in between the import of each video.

Full example

Retrieving import results

The result of every video that is imported is logged in the log file. These results can be retrieved from the log file as an array using the getLogAsArray method of the Importer object.

If desired, the import results as of a certain date (ignoring all import results from before that date) can retrieved from the log file by passing an instance of the DateTime object to the getLogAsArray method.

Unit Testing

To run the PHP unit tests, copy tests/config.example.yaml to tests/config.yaml and update tests/config.yml with the settings that apply to your publication.

Run the tests with the following commands.


All versions of bluebillywig-youtube-importer with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.1.3
ext-json Version *
guzzlehttp/guzzle Version ^6.3
bluebillywig/vmsrpc Version 0.97
norkunas/youtube-dl-php Version v1.1.0
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 wmrsp/bluebillywig-youtube-importer contains the following files

Loading the files please wait ....