YouTube Integration

WooCommerce YouTube Video Uploader – India’s Ropa

WooCommerce YouTube Video Uploader – India’s Ropa

WooCommerce and YouTube Integration

We’ve recently had an opportunity to create quite an interesting project. The client came asking whether or not I’d be able to create an automatic YouTube video uploader combined with WooCommerce products, created as WordPress plugin, the idea was to:

  1. Use the site uploaded video as the source.
  2. Upload the video to YouTube using YouTube API.
  3. Append the uploaded Video embed at the end of the WooCommerce product content.
  4. Shorten the product URL during the product creation.

Our idea to tackle the project was following:

  1. Use a URL shortening service to create short link and store it within a meta key of each product.
  2. Create separate page for YouTube authentication and store the authentication session until the default token expiration.
  3. If authenticated fetch the path of the media file and upload it to YouTube.
  4. In case of success append it to the end of the content.
  5. Flag the video (inside a meta key) as uploaded to avoid concurrent uploads.

The site may be found at https://www.indiasropa.com/. The attached gallery shows image samples of a simple Back End panel extension to create the result.