우수한 소프트웨어와 실용적인 튜토리얼
Douban 등급은 Apple CMS 백엔드에서 유효하지 않으며 Douban 등급 및 관련 정보를 얻을 수 없습니다.
애플 CMS쉽게 구축할 수 있는 희귀한 영화 및 TV CMS입니다.무료 영화 사이트수많은 저작권 분쟁으로 인해 Apple CMS는 공식 업데이트 및 유지 관리를 받지 못하고 있습니다. 현재 유지 관리가 이루어지지 않고 있습니다. 프로그램 배경은 자동으로 제공됩니다.두반 레이팅Douban API 업데이트로 인해 해당 함수에서 평점 및 정보를 가져올 수 없습니다. 이 문제를 해결해 보겠습니다.
Douban 등급 및 비디오 데이터를 수동으로 쿼리합니다.
아래는苹果cms v10 豆瓣评分信息采集api接口源码,将PHP源码复制保存为douban.php
그런 다음 douban.php를 웹사이트의 루트 디렉토리에 업로드합니다.
","
", $data); if($txt3==''){ $vod_pic = str_substr('"image": "','",', $data); $vod_score=str_substr('','', $data); //评分 $vod_reurl=str_substr('data-url="','"', $data); //豆瓣地址 $a_name=str_substr('','', $data); if(baohan($a_name,'剧情简介')=='1'){ $d_name=str_substr('','的剧情简介', ''.$a_name); }elseif(baohan($a_name,'的分集短评')=='1'){ $d_name=str_substr('','的分集', ''.$a_name); }elseif(baohan($a_name,'的演职员')=='1'){ $d_name=str_substr('','的演职员', ''.$a_name); }elseif(baohan($a_name,'的图片')=='1'){ $d_name=str_substr('','的图片', ''.$a_name); }elseif(baohan($a_name,'的短评')=='1'){ $d_name=str_substr('','的短评', ''.$a_name); }elseif(baohan($a_name,'的影评')=='1'){ $d_name=str_substr('','的影评', ''.$a_name); } $a_name=str_substr('','', $data); $vod_year=str_substr('(',')', $data); //年代 $txt1 = str_substr("导演: ","
", $data); $vod_director=preg_replace("/]*>(.*)<\/a>/isU",'${1}',$txt1); //导演 $txt = str_substr("主演: ","
", $data); $d_starring=preg_replace("/]*>(.*)<\/a>/isU",'${1}',$txt); $vod_actor=str_replace("'",',',$d_starring); //主演 $txt5 = str_substr("编剧: ","
", $data); $vod_writer=preg_replace("/]*>(.*)<\/a>/isU",'${1}',$txt5); //编辑 $txt2 = str_substr("类型: ","
", $data); $vod_class=preg_replace("/]*>(.*)<\/span>/isU",'${1}',$txt2); //分类 $vod_area = str_substr("制片国家/地区: ","
", $data); //地区 $vod_lang = str_substr("语言: ","
", $data); //语言 $d_subname=str_substr("又名: ","
", $data); $vod_sub=str_replace("'","'",$d_subname); //别名 $txt3 = str_substr("上映日期: ","
", $data); $vod_pubdate=preg_replace("/]*>(.*)<\/span>/isU",'${1}',$txt3); //上映日期 $vod_duration=str_substr('片长: ', $data); //片长 $d_content=str_substr('','', $data); if($d_content==''){ $d_content=str_substr(' ', $data); } $vod_content=str_replace("'","'",$d_content); //简介 $vod_total=''; //集数 if(strstr($vod_area,"中国")==true){ $vod_remarks='高清国语'; }elseif(strstr($vod_area,"台湾")==true){ $vod_remarks='高清国语'; }else{ $vod_remarks='高清中字'; } }else{ $vod_pic = str_substr('"image": "','",', $data); $vod_score=str_substr('','', $data); //评分 $vod_reurl=str_substr('data-url="','"', $data); //豆瓣地址 $a_name=str_substr('','', $data); if(baohan($a_name,'剧情简介')=='1'){ $d_name=str_substr('','的剧情简介', ''.$a_name); }elseif(baohan($a_name,'的分集短评')=='1'){ $d_name=str_substr('','的分集', ''.$a_name); }elseif(baohan($a_name,'的演职员')=='1'){ $d_name=str_substr('','的演职员', ''.$a_name); }elseif(baohan($a_name,'的图片')=='1'){ $d_name=str_substr('','的图片', ''.$a_name); }elseif(baohan($a_name,'的短评')=='1'){ $d_name=str_substr('','的短评', ''.$a_name); }elseif(baohan($a_name,'的影评')=='1'){ $d_name=str_substr('','的影评', ''.$a_name); } $a_name=str_substr('','', $data); $vod_year=str_substr('(',')', $data); //年代 $txt1 = str_substr("导演: ","
", $data); $vod_director=preg_replace("/]*>(.*)<\/a>/isU",'${1}',$txt1); //导演 $txt = str_substr("主演: ","
", $data); $vod_actor=preg_replace("/]*>(.*)<\/a>/isU",'${1}',$txt); //主演 $txt5 = str_substr("编剧: ","
", $data); $vod_writer=preg_replace("/]*>(.*)<\/a>/isU",'${1}',$txt5); //编辑 $txt2 = str_substr("类型: ","
", $data); $vod_class=preg_replace("/]*>(.*)<\/span>/isU",'${1}',$txt2); //分类 $vod_area = str_substr("制片国家/地区: ","
", $data); //国家 $vod_lang = str_substr("语言: ","
", $data); //语言 $d_subname=str_substr("又名: ","
", $data); $vod_sub=str_replace("'","'",$d_subname); //别名 $txt3 = str_substr("首播: ","
", $data); $vod_pubdate=preg_replace("/]*>(.*)<\/span>/isU",'${1}',$txt3); //上映日期 $vod_duration=str_substr('单集片长: ','
', $data); //片长 $vod_duration=str_replace("分钟","",$vod_duration); $d_content=str_substr('','', $data); if($d_content==''){ $d_content=str_substr(' ', $data); } $vod_content=str_replace("'","'",$d_content); //简介 $vod_total=str_substr('集数: ','
', $data); //集数 $vod_remarks='总集数'.$vod_total; } if($vod_sub==''){ $vod_sub=$a_name.$vod_year; } if($vod_year==''){ $vod_year='内详'; } if($vod_score==''){ $vod_score=rand(1,4).'.'.rand(0,9); } if($vod_director==''){ $vod_director='内详'; } if($vod_actor==''){ $vod_actor='内详'; } if($vod_content==''){ $vod_content='内详'; } if($d_name==''){ $vurl='({"code":102,"auth":"豆瓣评分","msg":"资料采集失败"});'; }else{ $info['vod_name'] = $d_name; $info['vod_sub'] = $vod_sub.','.$a_name; $info['vod_pic'] = $vod_pic; $info['vod_year'] = $vod_year; $info['vod_lang'] = $vod_lang; $info['vod_area'] = $vod_area; $info['vod_remarks'] = $vod_remarks; $info['vod_total'] = $vod_total; $info['vod_serial'] = ''; $info['vod_isend'] = 1; $info['vod_class'] = $vod_class; $info['vod_tag'] = ''; $info['vod_actor'] = $vod_actor; $info['vod_director'] = $vod_director; $info['vod_pubdate'] = $vod_pubdate; $info['vod_writer'] = $vod_writer; $info['vod_score'] = $vod_score; $info['vod_score_num'] = rand(100,1000); $info['vod_score_all'] = rand(200,500); $info['vod_douban_score'] = $vod_score; $info['vod_duration'] = strip_tags($vod_duration); $info['vod_reurl'] = $vod_reurl; $info['vod_author'] = $vod_author; $info['vod_content'] = cutstr_html($vod_content); $info['vod_douban_id'] = $id; $vurl='({"code":1,"auth":"豆瓣评分","msg":"资料采集成功","data":'.json_encode($info).'});'; } // file_put_contents($file,$vurl); } echo $callback.$vurl; }else{ echo $callback.'({"code":102,"auth":"豆瓣评分","msg":"资料采集失败"});'; } function baohan($str,$needle){ $tmparray = explode($needle,$str); if(count($tmparray)>1){ $yyy='1'; }else{ $yyy='2'; } return $yyy; } function tugeturl($url){ if(function_exists('curl_init')){ $ch = curl_init(); $timeout = 30; curl_setopt ($ch,CURLOPT_URL,$url); curl_setopt ($ch,CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查 curl_setopt ($ch,CURLOPT_SSL_VERIFYHOST, true); curl_setopt ($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt ($ch,CURLOPT_REFERER, $url); curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $handles = curl_exec($ch); curl_close($ch); }else{ $handles = @file_get_contents($url); } return $handles; } function geturl($url){ if(function_exists('curl_init')){ $ch = curl_init(); $timeout = 30; curl_setopt ($ch,CURLOPT_URL,$url); curl_setopt ($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt ($ch,CURLOPT_REFERER, $url); curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $handles = curl_exec($ch); curl_close($ch); }else{ $handles = @file_get_contents($url); } return $handles; } function getvrl($url){ $vurl = str_replace(array('"',"'"),array("'","‘"),$url); return $vurl; } function cutstr_html($string){ $string = strip_tags($string); $string = trim($string); $string = str_replace("\t","",$string); $string = str_replace("\r\n","",$string); $string = str_replace("\r","",$string); $string = str_replace("\n","",$string); $string = str_replace(" ","",$string); $string = str_replace(" ","",$string); return trim($string); } function str_substr($start, $end, $str){ $temp = explode($start, $str, 2); $content = explode($end, $temp[1], 2); return $content[0]; } ?>그런 다음 FTP에서 웹사이트의 /application/admin/view/vod/info.html 파일을 엽니다.
찾다:
url: '
719호선
시간 초과: 5000, url: '//' + 'api' + '.' + 'mac' + 'cms' + '.'+ 'la' + '/douban/index/id/' + id,위의 두 줄을 다음으로 바꾸세요.
시간 초과: 10000, url: 'https://yourdomain/douban.php?id=' + id,
이제 데이터 쿼리를 클릭하면 Douban 평점과 관련 콘텐츠를 성공적으로 얻을 수 있습니다.
douban.php 파일이 데이터를 반환하는지 테스트하려면 파일 뒤에 ?id=36151692를 추가합니다. 여기서 숫자는 Douban ID입니다.
https://귀하의 도메인 이름/douban.php?id=36151692
({"code":1,"auth":"두반 평점","msg":"데이터 수집 성공","data":{"vod_name":"\u5468\u5904\u9664\u4e09\u5bb3","vod_sub":"돼지, 뱀, 비둘기,\u5468\u5904\u9664\u4e09\u5bb3 \u5468\u8655\u9664\u4e09\u5bb3","vod_pic":"https:\/\/img3.doubanio.com\/view\/photo\/s_ratio_poster\/public\/p2905021483.jpg","vod_year":"2023" ,"vod_lang":"\u6c49\u8bed\u666e\u901a\u8bdd,\u95fd\u5357\u8bed,\u7ca4\u8 bed","vod_area":"\u4e2d\u56fd\u53f0\u6e7e","vod_remarks":"\u9ad8\u6e05\u 56fd\u8bed","vod_total":"","vod_serial":"","vod_isend":1,"vod_class":"\u52a8\u4f5c,\u72af\u7f6a","vod_tag":"","vod_actor":"\u962e\u7ecf\u5929,\ u8881\u5bcc\u534e,\u9648\u4ee5\u6587,\u738b\u51c0,\u8c22\u743c\u7156,\u6 74e\u674e\u4ec1,\u5218\u5b50\u94e8,\u66fe\u73ee\u745c,\u9648\u79c9\u4f51 ,\u6e38\u5b89\u987a,\u90d1\u6709\u6770,\u76db\u9274,\u5434\u5955\u84c9,\u9ec 4\u8fea\u626c,\u66fe\u5411\u9547,\u6c88\u5a01\u5e74,\u6768\u8fe6\u6069,\u66f e\u7693\u6cfd,\u90d1\u6c38\u5cb3,\u5f20\u542f\u4e50,\u82cf\u8000\u5ead,\u7ec 3\u5bb6\u8c6a,\u674e\u660e\u54f2,\u5ed6\u5a01\u8fea,\u7f57\u632f\u4f51,\u738 b\u53c8\u6b63,\u6797\u541b\u67d4,\u9ec4\u701a\u5fb7,\u5218\u5b50\u670b,\u7f5 7\u80fd\u534e,\u8bb8\u8389\u5ef7,\u6797\u745e\u534e,\u5218\u79be\u80b2,\u90e d\u5bb9\u817e,\u674e\u5e74\u96c4,\u8bb8\u5fb7\u57ce,\u9ec4\u60e0\u537f,\u521 8\u6615\u660a","vod_director":"\u9ec4\u7cbe\u752b","vod_pubdate":"2024-03-01(\u4e2d\u56fd\u5927\u9646),2023-10-06(\u4e2d\u56fd\u53f0\u6e7e)","vod_writer":"\u9ec4\u7cbe\u752b","vod_score":"8.1","vod_score_num":354,"vod_score_all": 331, "vod_douban_score": "8.1", "vod_duration": "134", "vod_reurl": "https:\/\/movie.douban.com\/subject\/36151692\/", "vod_author":null, "vod_content": "\u901a\u 7f09\u72af\u9648\u6842\u6797\uff08\u962e\u7ecf\u5929\u9970\uff09\u5728\u9003 \u4ea1\u85cf\u533f\u4e2d\u5931\u53bb\u6700\u540e\u4e00\u4e2a\u4eb2\u4eba\uff 0c\u540c\u65f6\u5f97\u77e5\u81ea\u5df1\u53ea\u6709\u4e0d\u5230\u4e09\u4e2a\u 6708\u7684\u751f\u547d\u3002\u4e07\u5ff5\u4ff1\u7070\u7684\u4ed6\u539f\u6253\ u7b97\u6295\u6848\u81ea\u9996\uff0c\u53ef\u662f\u5f53\u53d1\u73b0\u4ed6\u572 8\u4e09\u5927\u901a\u7f09\u72af\u4e2d\u4ec5\u4ec5\u6392\u540d\u7b2c\u4e09\u6 5f6\uff0c\u5185\u5fc3\u7a81\u7136\u8e81\u52a8\u8d77\u6765\u3002\u5728\u6b64\ u4e4b\u540e\uff0c\u4ed6\u51b3\u5b9a\u4eff\u6548\u53e4\u65f6\u5019\u5468\u590 4\u9664\u4e09\u5bb3\u7684\u6545\u4e8b\uff0c\u4e34\u7ec8\u4e4b\u9645\u8981\u5 728\u6c5f\u6e56\u4e0a\u7559\u4e0b\u4ed6\u7684\u4f20\u5947\u540d\u53f7\u3002\ u901a\u8fc7\u5730\u4e0b\u533b\u751f\u5f20\u8d35\u537f\uff08\u8c22\u743c\u715 6\u9970\uff09\uff0c\u9648\u6842\u6797\u627e\u5230\u4e86\u5206\u522b\u6392\u54 0d\u7b2c\u4e8c\u548c\u7b2c\u4e00\u7684\u9999\u6e2f\u4ed4\uff08\u8881\u5bcc\u 534e\u9970\uff09\u548c\u725b\u5934\u7684\u7ebf\u7d22\uff0c\u968f\u540e\u8e0f \u4e0a\u5f81\u9014\u3002\u8d2a\u55d4\u75f4\uff0c\u4e09\u6bd2\u71ac\u714e\uff 0c\u7ea2\u5c18\u6df7\u6c8c\u4e4b\u4eba\uff0c\u88ab\u4e1a\u969c\u7f20\u7ed5\uf f0c\u6c38\u8fdc\u65e0\u6cd5\u8df3\u8131\u56e0\u679c\u8f6e\u56de\u2026\u2026\ u7535\u5f71\u5f15\u7528\u7684\u201c\u5468\u5904\u9664\u4e09\u5bb3\u201d\u517 8\u6545\uff0c\u89c1\u4e8e\u300a\u664b\u4e66\u00b7\u5468\u5904\u4f20\u300b\u5 48c\u300a\u4e16\u8bf4\u65b0\u8bed\u300b\u3002","vod_douban_id":"36151692"}});데이터를 성공적으로 반환했습니다.두반 컬렉션적용되었습니다. 백엔드로 이동하여 업데이트하세요. 이 Douban 컬렉션의 유일한 단점은 수동 수집이 필요하다는 것입니다. Douban에서 관련 콘텐츠를 수집하려면 정보를 클릭하여 얻어야 합니다.
Apple CMS가 두 번째로 Douban ID와 Douban 점수를 수집하고 업데이트합니다.
Apple CMS를 사용하여 영화 및 TV 리소스 사이트에서 데이터를 수집할 때 일부 영화에는 등급과 Douban ID가 없습니다. 리소스 사이트를 두 번째로 업데이트하면 Douban ID와 등급은 존재하지만, 데이터베이스에 접속하면 Douban 등급을 동기적으로 업데이트할 수 없습니다. 이 문제를 해결하는 방법은 다음과 같습니다.
수집 매개변수 구성의 보조 업데이트 규칙에 Douban 등급 옵션이 없습니다. Apple CMS 관리 파일을 변경하여 Douban 등급 옵션을 추가해야 합니다.
열려 있는
애플리케이션/관리/뷰/시스템/configcollect.html
155번 라인
아래에 다음 코드를 추가하세요그런 다음 엽니다
애플리케이션/공통/모델/수집.php
539번째 줄의 코드를 바꾸세요.원래 코드
if($config['score']==1) { $v['vod_score_num'] = rand(1, 1000); $v['vod_score_all'] = $v['vod_score_num'] * rand(1, 10); $v['vod_score'] = round($v['vod_score_all'] / $v['vod_score_num'], 1); }로 교체
if($config['score']==1) { $v['vod_score_num'] = rand(1, 1000); $v['vod_score_all'] = $v['vod_score_num'] * rand(1, 10); //$v['vod_score'] = round($v['vod_score_all'] / $v['vod_score_num'], 1); $v['vod_score'] = $v['vod_douban_score']; }//$v['vod_score'] = round($v['vod_score_all'] / $v['vod_score_num'], 1);을 주석 처리하고 $v['vod_score'] = $v['vod_douban_score'];를 추가합니다.
마지막 단계, 886번째 줄
if ($config['urlrole'] == 1) {
$tmp1 = explode('#',$arr1[$down_key]);
$tmp2 = explode('#',$cj_down_url);
$tmp1 = 배열_병합($tmp1, $tmp2);
$tmp1 = array_unique($tmp1);
$cj_down_url = join('#', (배열)$tmp1);
$tmp1, $tmp2를 설정 해제합니다.
}
아래에 다음 코드를 추가하세요.
if (strpos(',' . $config['uprule'], 'tv')!==false && !empty($v['vod_douban_id']) && $v['vod_douban_id']!=$info['vod_douban_id']) { $update['vod_douban_id'] = $v['vod_douban_id']; } if (strpos(',' . $config['uprule'], 'av')!==false && !empty($v['vod_douban_score']) && $v['vod_douban_score']!=$info['vod_douban_id'] && $v['vod_douban_score'] != 0) { $update['vod_douban_score'] = $v['vod_douban_score']; }저장 후 업로드하고, 백그라운드에서 캐시를 지우고, 다시 업데이트할 때 두 번째 업데이트 규칙에서 두반 평점을 체크하면 두반 평점이 업데이트됩니다.