Tongbu.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. class Tongbu extends CI_Controller{
  4. function __construct(){
  5. parent::__construct();
  6. $this->load->database();
  7. }
  8. //同步
  9. public function index(){
  10. $id = intval($this->input->get_post('id'));
  11. if($id < 1) exit('参数错误');
  12. $exist = $this->db->query("select * from ".CS_SqlPrefix."video where id=".$id)->row();
  13. if(!$exist) exit('视频不存在');
  14. //发送api入库请求
  15. $add['code'] = 0;
  16. $add['vid'] = $exist->id;
  17. $add['cid'] = $exist->cid;
  18. $add['name'] = $exist->name;
  19. $add['size'] = formatsize($exist->size);
  20. $add['duration'] = formattime($exist->duration,1);
  21. $add['gifurl'] = m3u8_link($exist->pic,'gif'); //$add['m3u8url'] = m3u8_link($exist->m3u8);
  22. $add['gifurl'] = m3u8_link($exist->pic,'gif');
  23. $add['jpgurl'] = m3u8_link($exist->pic,'jpg');
  24. for($i=1;$i<Jpg_Num;$i++){
  25. $n = $i+1;
  26. $add['jpgurl_'.$n] = m3u8_link($picpath,'jpg',$n);
  27. }
  28. $add['playurl'] = 'http://'.Web_Url.links('play/'.$id);
  29. echo get_api('add',$add);
  30. }
  31. }