/** * 直接入库 array $html(cid)+string content.url * 先检测 ——>组合数据——>添加/更新 * @param string $url * @param array $html */ function videoImport($url, $html, $nid = '') { foreach ($html['playurl'] as $v) { $playurl .= $v . "\r\n"; } $html['playurl'] = trim($playurl); $check = $this->UpCheck($url, $html, $nid); if (!$check) { $this->error = $this->getError(); return false; } else { //组合数据 if (!empty($html['cname']) && (empty($html['cid']) || $html['cid'] == 999)) { if ($html['cid'] == 999) { //采集时未匹配到系统分类的 $cid = collect::get_Autochannel_id($html['cname'], $nid); //再次检测是否有对应自定义分类 if ($cid) { $html['cid'] = $cid; } } else { $html['cid'] = collect::get_syschannel_id($html['cname']); //cname 转换为系统栏目id } if (!$html['cid'] || $html['cid'] == 999) { $this->error = '没找到对应栏目,入库失败!'; return false; } unset($html['cname']); } $html['reurl'] = $url; if ($check != 'add' && $check != 'status') { //返回id更新数据 return $this->VideoSave($html, $nid, $check); } else { //新增 if ($check === 'status') { $html['status'] = -1; } return $this->VideoSave($html, $nid); } } }