VideoAnalyze.php 797 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\utils;
  3. use app\models\Option;
  4. class VideoAnalyze
  5. {
  6. private $baseApi = "https://www.345api.cn/api/";
  7. private $key;
  8. public $store_id;
  9. public $url = "jiexi/get";
  10. public function __construct() {
  11. }
  12. public function videoAnalyzeCurl($url = '') {
  13. if (!$url) {
  14. return json_encode([
  15. 'code' => 1,
  16. 'msg' => '请填写链接'
  17. ]);
  18. }
  19. $store_id = $this->store_id ?? 0;
  20. $key = Option::get('video_analyze_345', $store_id, 'saas', '')['value'];
  21. $this->key = $key;
  22. $api = $this->baseApi . $this->url . '?key=' . $this->key . '&url=' . urlencode($url);
  23. $key = $this->key;
  24. return cloud_get($api);
  25. }
  26. }