Executing (partially) the Batch Creator extension using the provided external script bc_ext.php.
support, ws.webtv, clips, batch, creator, developers, external, execution
Since WS.WebTV 3.0 it is possible to execute the Batch Creator (for creating Standard Clips and EmbedClips) externally - using, for example, cron jobs -, through the provided script "bc_ext.php" (WEBTV_BASE_URL/bc_ext.php?parameters...).
How does it works?
You only need to visit the script URL (directly or using a cron job, for example) with the appropriate parameters (URL/GET variables).
First: Set a password for the script!
We strongly recommend setting a password so that the external script can only be executed when the correct password is passed along the parameters. The password is a case sensitive text string (only use characters A-Z,a-z,0-9,-,_, do not use tilde or other special characters) and it must be set from the WebTV configuration file (config/Config.inc.php):
$BC_EXT_PASSWORD = "MySuperPassword"; // Make sure it is different than the "admin" and "master" passwords.
• clip_type (string - Required): Type of Clip to be created.
Possible values: standard (creates Standard Clips from files on video storage location), embed (creates EmbedClips from a YouTube, Vimeo or Dailymotion URL).
• process_item_limit (int): The maximum amount of Clips which will be created.
Default value (if nothing is provided): 1 (create only one Clip).
Possible values: 0 (no limit), bigger than 0 (limit).
• activate_created_clips (int): Whether to activate the created Clips.
Default value (if nothing is provided): 1 (activate)
Possible values: 1 (activate), 0 (do not activate).
• pw (string - Required if password has been set in the configuration file): The password for the external script. It must match the string entered in the WebTV configuration file (config/Config.inc.php), variable $BC_EXT_PASSWORD.
Default value: Empty string (no password).
• url (EmbedClip-specific parameter / string - Required): The URL of YouTube, Vimeo or Dailymotion video. In the case of YouTube it can be the URL of a YouTube channel/user.
• default_quality_id (Standar Clip-specific parameter / int): The ID of the quality used by default in the case of files which do not have a quality specified in the name.
Default value (if nothing is provided): 1.
EmbedClip case (max. Clips = 10, activate created Clips, YouTube User URL):
http://WEBTV_URL/bc_ext.php?clip_type=embed&pw=[password]&process_item_limit=10&activate_created_clips=1&url=https://www.youtube.com/user/WHATEVERUSER/videos
Standard Clip case (max. Clips = 10, default quality ID = 1, activate created Clips):
http://WEBTV_URL/bc_ext.php?clip_type=standard&pw=[password]&process_item_limit=10&default_quality_id=1&activate_created_clips=1
Executing from a cron job?
No problem, simply make sure that script is executed using its absolute URL (like the previous examples) with a lynx, wget or curl cron command.