application/admin/view/system/configcollect.html
第155行左右增加如下代码
<input type="checkbox" lay-skin="primary" name="collect[vod][uprule][]" value="tv" title="豆瓣ID" {if condition="strpos($config['collect']['vod']['uprule'],'tv') !==false"}checked {/if}>
<input type="checkbox" lay-skin="primary" name="collect[vod][uprule][]" value="av" title="豆瓣评分" {if condition="strpos($config['collect']['vod']['uprule'],'av') !==false"}checked {/if}>
application/common/model/Collect.php
中在538行 $v['vod_score'] = round($v['vod_score_all'] / $v['vod_score_num'], 1);下增加如下代码
//$v['vod_score'] = round($v['vod_score_all'] / $v['vod_score_num'], 1);
// 模板score评分排序无效,所以将douban_score值赋给score
$v['vod_score'] = $v['vod_douban_score'];
application/common/model/Collect.php
中在第886行左右增加如下代码
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'];
}
后台效果:
苹果cms v10 豆瓣评分信息采集api接口源码
把douban.php文件放到:根目录/api 文件夹下
打开/application/admin/view/vod/info.html 搜索url: '
timeout: 5000,
url: '//' + 'api' + '.' + 'mac'+ 'cms' + '.'+ 'la' + '/douban/index/id/' + id,
替换为:
timeout: 10000,
url: 'https://你的域名/api/douban.php?id=' + id,
有极个别视频可能无法获取评分,原因不详,可根据弹窗提示联系作者解决。
({"code":1,"auth":"冷曦博客免费转发分享!","msg":"博客www.lengxi.net","data":{"vod_name":"\u597d\u4e1c\u897f","vod_sub":"\u7231\u60c5\u795e\u8bdd\u5e73\u884c\u7bc7\uff1a\u597d\u4e1c\u897f,\u7231\u60c5\u795e\u8bdd\u00b7\u5e73\u884c\u7bc7,\u7231\u60c5\u795e\u8bdd2,Herstory,Her Story,\u597d\u4e1c\u897f","vod_pic":"https:\/\/img2.doubanio.com\/view\/photo\/s_ratio_poster\/public\/p2915454411.jpg","vod_year":"2024","vod_lang":"\u6c49\u8bed\u666e\u901a\u8bdd","vod_area":"\u4e2d\u56fd\u5927\u9646","vod_remarks":"\u9ad8\u6e05\u56fd\u8bed","vod_total":"","vod_serial":"","vod_isend":1,"vod_class":"\u5267\u60c5,\u7231\u60c5","vod_tag":"","vod_actor":"\u5b8b\u4f73,\u949f\u695a\u66e6,\u66fe\u6155\u6885,\u7ae0\u5b87,\u8d75\u53c8\u5ef7,\u4efb\u5f6c,\u5f20\u5f1b,\u5468\u91ce\u8292,\u738b\u83ca,\u5b54\u8fde\u987a,\u848b\u6613,\u6768\u82f1\u683c,\u5b89\u680b,\u51af\u739b\u5a05","vod_director":"\u90b5\u827a\u8f89","vod_pubdate":"2024-11-22(\u4e2d\u56fd\u5927\u9646),2024-11-13(\u91d1\u9e21\u56fd\u4ea7\u7535\u5f71\u5c55),2024-11-16(\u5927\u89c4\u6a21\u70b9\u6620)","vod_writer":"\u90b5\u827a\u8f89","vod_score":"9.1","vod_score_num":376,"vod_score_all":469,"vod_douba
我放好douban.php,为什么请求查询时会显示File not found.呀
把douban.php文件放到:根目录/api 文件夹下
application/common/model/Collect.php中在第886行左右增加如下代码
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'];
}
大佬这个代码加到哪里,感觉加里好像会报错我是不是加错了
更新了图片,请参考,这段代码前后都是二次更新的选项,加在哪个if前后都是可以的
可以,非常完美
您好大佬,这个douban.php要放在哪里
这个看你的/application/admin/view/vod/info.html里边怎么写了,只要路径统一就可以,我这里是放在api目录
谢谢大佬,可以用啦,非常棒