找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1411|回复: 9

[其它网络视频相关] 请问大佬恩山开源双端自动去除重复源这个功能怎么给他屏蔽掉

[复制链接]
发表于 2022-6-24 14:40 | 显示全部楼层 |阅读模式
下面是channeladminController.php的代码,请大佬指教
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set('display_startup_errors', 1);
  4. error_reporting(E_ERROR);

  5. if ($_SESSION['channeladmin'] == 0) {
  6.     exit("<script>$.alert({title: '警告',content: '你无权访问此页面。',type: 'orange',buttons: {confirm: {text: '确定',btnClass: 'btn-primary',action: function(){history.go(-1);}}}});</script>");
  7. }

  8. ?>

  9. <?php
  10. $categorytype = $_GET['type'];
  11. // 对分类进行重新排序
  12. function sort_id() {
  13.     global $categorytype, $db;
  14.     if ($categorytype == 'default') {
  15.         $numCount = 1;
  16.     } else if ($categorytype == 'province') {
  17.         $numCount = 50;
  18.     } else if ($categorytype == 'chinanet') {
  19.         $numCount = 100;
  20.     } else if ($categorytype == 'unicom') {
  21.         $numCount = 150;
  22.     } else if ($categorytype == 'cmcc') {
  23.         $numCount = 200;
  24.     } else if ($categorytype == 'vip') {
  25.         $numCount = 250;
  26.     }
  27.     $result = $db->mQuery("SELECT * from luo2888_category where type='$categorytype' order by id");
  28.     while ($row = mysqli_fetch_array($result)) {
  29.         $name = $row['name'];
  30.         $db->mSet("luo2888_category", "id=$numCount", "where name='$name'");
  31.         unset($name);
  32.         $numCount++;
  33.     }
  34.     unset($row);
  35.         mysqli_free_result($result);
  36. }
  37. sort_id();
  38. // 检测上下移的ID参数是否存在
  39. function chk_sort_id() {
  40.     global $categorytype, $minid, $maxid, $db;
  41.     if ($row = $db->mGetRow("luo2888_category", "min(id),max(id)", "where type='$categorytype'")) {
  42.         $minid = $row['min(id)'];
  43.         $maxid = $row['max(id)'];
  44.     }
  45. }
  46. chk_sort_id();
  47. // 增加频道列表
  48. function add_channel_list($cname, $srclist) {
  49.     global $db;
  50.     if (!empty($srclist && $cname)) {
  51.         $db->mDel("luo2888_channels", "where category='$cname'");
  52.         $repetnum = 0;
  53.         $rows = explode("\n", $srclist);
  54.         $rows = preg_replace('# ,#', ',', $rows);
  55.         $rows = preg_replace('#\r#', '', $rows);
  56.         //$rows = preg_replace('/高清/', '', $rows);
  57.         //$rows = preg_replace('/FHD/', '', $rows);
  58.         //$rows = preg_replace('/HD/', '', $rows);
  59.         //$rows = preg_replace('/SD/', '', $rows);
  60.         //$rows = preg_replace('/\[.*?\]/', '', $rows);
  61.         //$rows = preg_replace('/\#genre\#/', '', $rows);
  62.         //$rows = preg_replace('/ver\..*?\.m3u8/', '', $rows);
  63.         //$rows = preg_replace('/t\.me.*?\.m3u8/', '', $rows);
  64.         //$rows = preg_replace("/https(.*)www.bbsok.cf[^>]*/", "", $rows);
  65.         foreach($rows as $row) {
  66.             if (strpos($row, ',') !== false) {
  67.                 $ipos = strpos($row, ',');
  68.                 $channelname = substr($row, 0, $ipos);
  69.                 $source = substr($row, $ipos + 1);
  70.                 if (strpos($source, '#') !== false) {
  71.                     $sources = explode("#", $source);
  72.                     foreach ($sources as $src) {
  73.                         $src2 = str_replace(""", "", $src);
  74.                         $src2 = str_replace("\'", "", $src2);
  75.                         $src2 = str_replace("}", "", $src2);
  76.                         $src2 = str_replace("{", "", $src2);
  77.                         $channelurl = $db->mQuery("SELECT url from luo2888_channels");
  78.                         while ($url = mysqli_fetch_array($channelurl)) {
  79.                             if ($src2 == $url[0]) {
  80.                                 $src2 = '';
  81.                                 $repetnum++;
  82.                             }
  83.                         }
  84.                         unset($url);
  85.                         mysqli_free_result($channelurl);
  86.                         if ($channelname != '' && $src2 != '') {
  87.                             $db->mInt("luo2888_channels", "id,name,url,category", "NULL,'$channelname','$src2','$cname'");
  88.                         }
  89.                     }
  90.                 } else {
  91.                     $src2 = str_replace(""", "", $source);
  92.                     $src2 = str_replace("\'", "", $src2);
  93.                     $src2 = str_replace("}", "", $src2);
  94.                     $src2 = str_replace("{", "", $src2);
  95.                     $channelurl = $db->mQuery("SELECT url from luo2888_channels");
  96.                     while ($url = mysqli_fetch_array($channelurl)) {
  97.                         if ($src2 == $url[0]) {
  98.                             $src2 = '';
  99.                             $repetnum++;
  100.                         }
  101.                     }
  102.                     unset($url);
  103.                                         mysqli_free_result($channelurl);
  104.                     if ($channelname != '' && $src2 != '') {
  105.                         $db->mInt("luo2888_channels", "id,name,url,category", "NULL,'$channelname','$src2','$cname'");
  106.                     }
  107.                 }
  108.             }
  109.         }
  110.         unset($rows, $srclist);
  111.         return $repetnum;
  112.     }
  113.     return -1;
  114. }
  115. // 获取分类名称
  116. if (isset($_GET['category'])) {
  117.     $cname = $_GET['category'];
  118. } else {
  119.     if ($row = $db->mGetRow("luo2888_category", "name", "order by id")) {
  120.         $cname = $row['name'];
  121.         unset($row);
  122.     } else {
  123.         $cname = '';
  124.     }
  125. }
  126. // 修改频道列表
  127. if (isset($_POST['submit']) && isset($_POST['category']) && isset($_POST['srclist'])) {
  128.     $cname = $_POST['category'];
  129.     $srclist = $_POST['srclist'];
  130.     $showindex = $_POST['showindex'];
  131.     $listreturn = add_channel_list($cname, $srclist);
  132.     if ($listreturn != -1) {
  133.         echo"<script>showindex=$showindex;lightyear.notify('保存成功!$listreturn 个重复节目源!', 'success', 3000);</script>";
  134.     } else {
  135.         echo"<script>showindex=$showindex;lightyear.notify('保存失败,列表不能为空!', 'danger', 3000);</script>";
  136.     }
  137.     unset($srclist);
  138. }
  139. // 增加分类
  140. if (isset($_POST['submit']) && isset($_POST['category'])) {
  141.     $category = $_POST['category'];
  142.     $cpass = $_POST['cpass'];
  143.     if ($category == "") {
  144.         echo "<script>lightyear.notify('类别名称不能为空!', 'danger', 3000);</script>";
  145.     } else {
  146.         $numCount = $maxid + 1;
  147.         $categoryname = $db->mGetRow("luo2888_category", "name", "where name='$category'");
  148.         if (empty($categoryname)) {
  149.             $db->mInt("luo2888_category", "id,name,psw,type", "$numCount,'$category','$cpass','$categorytype'");
  150.             $showindex = $db->mGet("luo2888_category", "count(*)", "where type='$categorytype'") - 1;
  151.             echo "<script>showindex=$showindex;lightyear.notify('增加类别$category 成功!', 'success', 3000);</script>";
  152.             sort_id();
  153.             mysqli_free_result($result);
  154.             $cname = $category;
  155.         }
  156.     }
  157. }
  158. // 增加外部列表
  159. if (isset($_POST['addthirdlist'])) {
  160.     $category = $_POST['thirdlistcategory'];
  161.     $listurl = $_POST['thirdlisturl'];
  162.     $srclist = file_get_contents($listurl);
  163.     if ($category == "") {
  164.         echo "<script>lightyear.notify('类别名称不能为空!', 'danger', 3000);</script>";
  165.     } else {
  166.         $numCount = $maxid + 1;
  167.         $categoryname = $db->mGetRow("luo2888_category", "name", "where name='$category'");
  168.         if (empty($categoryname)) {
  169.             $db->mInt("luo2888_category", "id,name,psw,type,url", "$numCount,'$category','$cpass','$categorytype','$listurl'");
  170.             $showindex = $db->mGet("luo2888_category", "count(*)", "where type='$categorytype'") - 1;
  171.             $addlist = add_channel_list($category, $srclist);
  172.             if ($addlist !== -1) {
  173.                 echo "<script>showindex=$showindex;lightyear.notify('增加列表$category 成功!', 'success', 3000);</script>";
  174.             } else {
  175.                 echo "<script>showindex=$showindex;lightyear.notify('增加列表$category 失败!', 'danger', 3000);</script>";
  176.                 $db->mDel("luo2888_category", "where name='$category'");
  177.             }
  178.             sort_id();
  179.         }
  180.     }
  181. }
  182. // 更新外部列表
  183. if (isset($_POST['updatelist'])) {
  184.     $category = $_POST['thirdlist'];
  185.         $listurl=$db->mGet("luo2888_category", "url", "where name='$category'");
  186.     $srclist = file_get_contents($listurl);
  187.     if ($category == "") {
  188.         echo "<script>lightyear.notify('列表名称不能为空!', 'danger', 3000);</script>";
  189.     } else {
  190.         $listurl = $db->mGetRow("luo2888_category", "url", "where name='$category'");
  191.         $addlist = add_channel_list($category, $srclist);
  192.         if ($addlist !== -1) {
  193.             echo "<script>$.alert({title: '成功',content: '更新列表$category 成功!',type: 'green',buttons: {confirm: {text: '好',btnClass: 'btn-primary',action: function(){location.replace(location.href);}}}});</script>";
  194.         } else {
  195.             echo "<script>$.alert({title: '成功',content: '更新列表$category 失败!',type: 'green',buttons: {confirm: {text: '好',btnClass: 'btn-primary',action: function(){location.replace(location.href);}}}});</script>";
  196.         }
  197.     }
  198. }
  199. // 删除分类
  200. if (isset($_POST['submit_deltype']) && isset($_POST['category'])) {
  201.     $category = $_POST['category'];
  202.     $showindex = $_POST['showindex'];
  203.     if ($category == "") {
  204.         echo "<script>lightyear.notify('类别名称不能为空!', 'danger', 3000);</script>";
  205.     } else {
  206.         if ($categoryid = $db->mGet("luo2888_category", "id", "where name='$category'")) {
  207.             $db->mSet("luo2888_category", "id=id-1", "where id>$categoryid");
  208.         }
  209.         $db->mDel("luo2888_category", "where name='$category'");
  210.         $db->mDel("luo2888_channels", "where category='$category'");
  211.         sort_id();
  212.         echo "<script>showindex=$showindex-1;lightyear.notify('$category 删除成功!', 'success', 3000);</script>";
  213.     }
  214. }
  215. // 修改分类
  216. if (isset($_POST['submit_modifytype']) && isset($_POST['category'])) {
  217.     $category = $_POST['category'];
  218.     $cpass = $_POST['cpass'];
  219.     $showindex = $_POST['showindex'];
  220.     $category0 = $_POST['typename0'];
  221.     if ($category == "") {
  222.         echo "<script>lightyear.notify('类别名称不能为空!', 'danger', 3000);</script>";
  223.     } else {
  224.         $db->mSet("luo2888_category", "name='$category',psw='$cpass'", "where name='$category0'");
  225.         $db->mSet("luo2888_channels", "category='$category'", "where category='$category0'");
  226.         echo "<script>showindex=$showindex;lightyear.notify('$category 修改成功!', 'success', 3000);</script>";
  227.         $cname = $category;
  228.     }
  229. }
  230. // 上移分类
  231. if (isset($_POST['submit_moveup']) && isset($_POST['category'])) {
  232.     $category = $_POST['category'];
  233.     $showindex = $_POST['showindex'];
  234.     if ($id = $db->mGet("luo2888_category", "id", "where name='$category'")) {
  235.         $preid = $id-1;
  236.         if ($preid >= $minid) {
  237.             $db->mSet("luo2888_category", "id=id+1", "where id=$preid");
  238.             $db->mSet("luo2888_category", "id=id-1", "where name='$category'");
  239.             echo "<script>showindex=$showindex-1;</script>";
  240.         } else {
  241.             echo "<script>showindex=$showindex-1;lightyear.notify('已经上移到最顶了!', 'danger', 3000);</script>";
  242.         }
  243.     }
  244. }
  245. // 下移分类
  246. if (isset($_POST['submit_movedown']) && isset($_POST['category'])) {
  247.     $category = $_POST['category'];
  248.     $showindex = $_POST['showindex'];
  249.     if ($id = $db->mGet("luo2888_category", "id", "where name='$category'")) {
  250.         $nextid = $id + 1;
  251.         if ($nextid <= $maxid) {
  252.             $db->mSet("luo2888_category", "id=id-1", "where id=$nextid");
  253.             $db->mSet("luo2888_category", "id=id+1", "where name='$category'");
  254.             echo "<script>showindex=$showindex+1;</script>";
  255.         } else {
  256.             echo "<script>showindex=$showindex;lightyear.notify('已经下移到最底了!', 'danger', 3000);</script>";
  257.         }
  258.     }
  259. }
  260. // 置顶分类
  261. if (isset($_POST['submit_movetop']) && isset($_POST['category'])) {
  262.     $category = $_POST['category'];
  263.     if ($id = $db->mGet("luo2888_category", "Min(id)", "where type='$categorytype'")) {
  264.         $id = $id-1;
  265.         $db->mSet("luo2888_category", "id=$id", "where name='$category'");
  266.         sort_id();
  267.         echo "<script>showindex=0;</script>";
  268.     }
  269. }
  270. // 列表设置
  271. if (isset($_POST['submit']) && isset($_POST['ver'])) {
  272.     $updateinterval = $_POST['updateinterval'];
  273.     if (isset($_POST['autoupdate'])) {
  274.                 $db->mSet("luo2888_config", "value='1'", "where name='autoupdate'");
  275.                 $db->mSet("luo2888_config", "value='$updateinterval'", "where name='updateinterval'");
  276.     } else {
  277.         $ver = $_POST['ver'];
  278.                 $db->mSet("luo2888_config", "value='0'", "where name='autoupdate'");
  279.                 $db->mSet("luo2888_config", "value='$ver'", "where name='dataver'");
  280.     }
  281.     echo "<script>lightyear.notify('保存成功!', 'success', 3000);</script>";
  282. }
  283. // 分类开关
  284. if (isset($_POST['checkpdname'])) {
  285.     $db->mSet("luo2888_category", "enable=0");
  286.     foreach ($_POST['enable'] as $categoryenable) {
  287.         $db->mSet("luo2888_category", "enable=1", "where name='$categoryenable'");
  288.     }
  289. }
  290. // 获取列表设置
  291. $ver = $db->mGet("luo2888_config", "value", "where name='dataver'");
  292. $versionname = $db->mGet("luo2888_config", "value", "where name='appver'");
  293. $autoupdate = $db->mGet("luo2888_config", "value", "where name='autoupdate'");
  294. $updateinterval = $db->mGet("luo2888_config", "value", "where name='updateinterval'");

  295. if ($autoupdate == 1) {
  296.     $checktext = "checked='true'";
  297. } else {
  298.     $checktext = '';
  299. }

  300. ?>
复制代码
我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-6-24 15:25 | 显示全部楼层
        echo"<script>showindex=$showindex;lightyear.notify('保存成功!$listreturn 个重复节目源!', 'success', 3000);</script>";
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-24 15:33 | 显示全部楼层
相关代码应该是在50行至117行里面,
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-24 16:16 | 显示全部楼层
删掉81~86;99~104语句试试

评分

参与人数 1恩山币 +1 收起 理由
少*** + 1 强大的恩山!(以下重复1万次)

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-24 20:36 | 显示全部楼层
那么问题来了,屏蔽高清,HD字样,怎样去除?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-24 20:36 | 显示全部楼层
那么问题来了,屏蔽高清,HD字样,怎样去除?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-24 22:40 来自手机 | 显示全部楼层
我发布的帖子里面有方法

点评

请问老哥,app老是闪退是什么原因呢?  详情 回复 发表于 2022-6-24 23:38
谢谢!成功了  详情 回复 发表于 2022-6-24 23:08
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-24 23:08 | 显示全部楼层
45430770 发表于 2022-6-24 22:40
我发布的帖子里面有方法

谢谢!成功了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-24 23:38 | 显示全部楼层
45430770 发表于 2022-6-24 22:40
我发布的帖子里面有方法

请问老哥,app老是闪退是什么原因呢?

点评

这就不知道了也可能是哪里没设置好  详情 回复 发表于 2022-6-25 12:34
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-6-25 12:34 来自手机 | 显示全部楼层
tong920620 发表于 2022-6-24 23:38
请问老哥,app老是闪退是什么原因呢?

这就不知道了也可能是哪里没设置好
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 04:24

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表