phpface
  • Introduction
  • Installation
  • Verify License
  • Install Plugins
  • Import Sample Content
  • Content Capabilities
  • Theme Options
  • Site Logo
  • Elementor Widgets
  • Sidebars
  • Shortcodes
  • Widgets
  • Add Menu
  • Add Custom User Dashboard Pages
  • Mobile Bottom Menu
  • Upload/Embed Video
  • Upload Big Files
  • Transcode and Encrypt Video With FFmpeg
  • Video Collections
  • Video Chapters
  • Import YouTube Videos
  • Post Location
  • Live Chat and Private Messages
  • User Dashboard
  • Video Advertising
  • BuddyPress (Activity Stream, Notifications, User Groups, Friend Connections ... etc)
  • Restrict Content
  • User Registration / Membership
    • Patreon Membership
    • Paid Membership Pro
    • Paid Member Subscriptions
  • myCred
  • ACF - Advanced Custom Fields
  • Create User Channels
  • WP Statistics (Page Views, Reports, Analytics ...)
  • Sitekit By Google (Page Views, Reports, Analytics ...)
  • Limit Backend Access
  • Bunny Stream
  • Cloudflare Stream
  • DynTube Stream
  • WooCommerce - Sell Video Content
  • Dokan - WooCommerce Multivendor Marketplace.
  • Forums
  • Search Everything in WordPress
  • Translation
  • Changelogs
  • For Developers
    • Add Custom Meta Boxes
    • REST APIs & Upload
  • FAQs
    • How to resolve 404 Error?
    • How to update the theme and all bundled plugins?
    • How to update all bundled plugins?
    • What is a Short Video?
  • How to solve "video is being encoded, please wait a minute" issue?
  • How to Add Custom Roles and Capabilities?
  • How to set custom single video template?
  • End
    • Thank you!
  • Customer Support
Powered by GitBook
On this page

Import YouTube Videos

PreviousVideo ChaptersNextPost Location

Last updated 1 month ago

  1. (New - Since 4.0)

  2. (deprecated)

  3. (deprecated)

  4. (deprecated)


Frontend Dashboard Screen

Since version 4.0, the YouTube Importer UI can be managed directly from the frontend dashboard, just like in the backend. See "Backend Screen - Add An Importer" below for further instructions on how to add importers.


The YouTube Importer screen is displayed for administrators by default. To grant access to regular members, follow these steps:

  1. Navigate to your Frontend Dashboard > Settings > Capabilities.

  2. Select "Post Type: YouTube Importer".

  3. Choose a specific user role to grant permissions to, or select "All" to apply changes to all roles.

  4. Check the necessary capability checkboxes.

For more information about Content Capablities, please refer to Content Capabilities

Avoid granting "edit_others_yt_importers" and "delete_others_yt_importers" capabilities, as these are intended for moderators such as administrators and editors only.


Backend Screen - Add An Importer


Navigate to Videos > YouTube Importers > Add New

  1. Add Title: Enter a custom title for the importer, for example: My Music

  2. Enable: Enable the importer in case of running automatically via hosting Cron Job

  3. Youtube API Key : Enter your own Youtube API key

  4. Search: Specifies the query term to search for. Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the search field value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the search field value to boating|sailing -fishing.

  5. Channel/Playlist ID: The field value indicates that the API response should only contain resources created by the channel.

  6. Max Results Specifies the maximum number of items that should be returned in the result set. Acceptable values are 0 to 50

  7. Event Type: Restricts a search to broadcast events

  8. Video Type: Restrict a search to a particular type of videos

  9. Safe Search: Indicates whether the search results should include restricted content as well as standard content.

  10. Video Definition: Restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available

  11. Video Dimension: Restrict a search to only retrieve 2D or 3D videos

  12. Video Duration: Filters video search results based on their duration

  13. Video License: Filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos.

  14. Published After: Indicates that the API response should only contain resources created at or after the specified time

  15. Published Before: Indicates that the API response should only contain resources created before or at the specified time

  16. Region Code: Instructs the API to return search results for videos that can be viewed in the specified country

  17. Relevance Language: Instructs the API to return search results that are most relevant to the specified language

  18. Video Categories: Choose the video categories the videos will be imported to

  19. Video Tags: Choose the video tags the videos will be imported to

  20. Import Tags: Imports video keywords

You can add many importers as you wish


Authenticate with Google OAuth

Since version 4.0, there is no need to manually create an API key, as the theme now supports authentication using Google OAuth. This ensures proper permissions when interacting with the YouTube API.

Navigate to Customize > Theme Options > Google OAuth and provide your Google Client ID and Google Client Secret keys.

Your Google OAuth App must have "YouTube Data API v3" enabled for proper functionality.

Assign Capabilities

For detailed instructions on assigning capabilities, please refer to Content Capabilities

  1. Select the "Post Type: YouTube Importers".

  2. Choose a specific user role to grant permissions to, or "All" to retrieve all roles.

  3. Check the necessary capability checkboxes.


Create A YouTube API Key (deprecated)

Since version 4.x, creating an API key is no longer necessary, as authentication is now handled through OAuth. OAuth provides a more secure and user-friendly way for users to connect their accounts directly without manually entering API keys.


Manual Import


Auto Import Using Hosting Cronjob (deprecated)


Copy the CronTab URL of Importer and set it up in your Hosting Panel

For example, with DreamHost hosting

Command

OR

curl 'http://domain.com/youtube_importer/my-music/?key=123456789'


Auto Import Using WP Control Plugin (deprecated)

  • Navigate to Tools > Cron Events > Add New

  • Choose and fill in the necessary fields and click the "Add Event" button.

    file_get_contents( 'your crontab url' );


Filter Post Arguments

Your app may need to be verified. Follow the Manage OAuth App Branding guide for further instructions

See "Implementing OAuth 2.0 Authorization" for further instructions

wget

Install and Activate WP Control plugin

https://support.google.com/cloud/answer/15549049?sjid=17774368760552836686-NC
https://developers.google.com/youtube/v3/guides/authentication
Creating a cron job in the panel
Running a cron job from a URL with variables
http://domain.com/youtube_importer/my-music/?key=123456789
https://wordpress.org/plugins/wp-crontrol/
Manual Import
Add An Importer
Authenticate with Google OAuth
Assign Capabilities
Create A YouTube API Key
Auto Import Using Hosting Cronjob
Auto Import Using WP Control Plugin
Filter Post Arguments
Create Google OAuth Project
Example code snippet to modify WP video post date based on YouTube-formatted date before inserting into the database.
YouTube Importers Capabilities