IrascibleMe

Bitchute Blocklist V3

Aug 30th, 2020 (edited)
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 12.32 KB | None | 0 0
  1. <?php
  2. function Indent($count)
  3. {
  4.     $indent = "";
  5.     for ($i = 0; $i < $count; $i++) {
  6.         $indent = $indent . " ";
  7.     }
  8.     return $indent;
  9. }
  10. function Top()
  11. {
  12.     print "<!DOCTYPE html>\n";
  13.     print "<html>\n";
  14.     print Indent(1) . "<head>\n";
  15.     print Indent(2) . "<meta charset=\"UTF-8\">\n";
  16.     print Indent(2) . "<title>Bitchute Blocklist</title>\n";
  17.     print Indent(1) . "</head>\n";
  18.     print Indent(1) . "<body>\n";
  19.     print Indent(2) . "<script src=\"panel.js\"></script>\n";
  20.     print "\t\t<h1>Bitchute Blocklist</h1>\n";
  21.     print Indent(2) . "<div class=\"form-block-user\">\n";
  22.     print Indent(3) . "<h2>User Blocking</h2>\n";
  23.     print Indent(3) . "<form method=\"post\" action=\"/BTList.php\">\n";
  24.     print Indent(4) . "<input type=\"checkbox\" id=\"AV\" name=\"AV\" value=\"1\" checked=\"1\" title=\"Block User Avatar\">\n";
  25.     print Indent(4) . "<label for=\"AV\" title=\"Block User Avatar\">Avatar</label>\n";
  26.     print Indent(4) . "<input type=\"checkbox\" id=\"AC\" name=\"AC\" value=\"1\" checked=\"1\" title=\"Block User Actions Bar\">\n";
  27.     print Indent(4) . "<label for=\"AC\" title=\"Block User Actions Bar\">Actions</label>\n";
  28.     print Indent(4) . "<input type=\"checkbox\" id=\"CM\" name=\"CM\" value=\"1\" checked=\"1\" title=\"Block User Comments\">\n";
  29.     print Indent(4) . "<label for=\"CM\" title=\"Block User Comments\">Comments</label>\n";
  30.     print Indent(4) . "<input type=\"checkbox\" id=\"AT\" name=\"AT\" value=\"1\" checked=\"1\" title=\"Block User Attachments\">\n";
  31.     print Indent(4) . "<label for=\"AT\" title=\"Block User Attachments\">Attachments</label><br>\n";
  32.     print Indent(4) . "<label for=\"BID\" title=\"data-user-id To Block\">ID to block:</label>\n";
  33.     print Indent(4) . "<input type=\"text\" id=\"BID\" name=\"BID\" value=\"\" title=\"data-user-id To Block\">\n";
  34.     print Indent(4) . "<input type=\"submit\" value=\"&#127988;\">\n";
  35.     print Indent(3) . "</form>\n";
  36.     print Indent(2) . "</div>\n";
  37.  
  38.     print Indent(2) . "<div class=\"form-block-word\">\n";
  39.     print Indent(3) . "<h2>Language Blocking</h2>\n";
  40.     print Indent(3) . "<form method=\"post\" action=\"/BTList.php\">\n";
  41.     print Indent(4) . "<label for=\"BWD\">Word(s) to block:</label>\n";
  42.     print Indent(4) . "<input type=\"text\" id=\"BWD\" name=\"BWD\" value=\"\">\n";
  43.     print Indent(4) . "<input type=\"submit\" value=\"&#127988;\">\n";
  44.     print Indent(3) . "</form>\n";
  45.     print Indent(2) . "</div>\n";
  46. }
  47.  
  48. function Bottom()
  49. {
  50.     print Indent(1) . "</body>\n";
  51.     print "</html>";
  52. }
  53.  
  54. function Content()
  55. {
  56.     $file = "./blocklist.txt";
  57.     print Indent(2) . "<div class=\"blocked-users\">\n";
  58.     print Indent(3) . "<h2>Blocked Users</h2>\n";
  59.     print Indent(3) . "<table>\n";
  60.     print Indent(4) . "<tr>\n";
  61.     print Indent(5) . "<th>ID</th>\n";
  62.     print Indent(5) . "<th>AV</th>\n";
  63.     print Indent(5) . "<th>AC</th>\n";
  64.     print Indent(5) . "<th>CM</th>\n";
  65.     print Indent(5) . "<th>AT</th>\n";
  66.     print Indent(5) . "<th>Del</th>\n";
  67.     print Indent(4) . "</tr>\n";
  68.     $nchar = "&#128405;";
  69.     $ychar = "&#128077;";
  70.     $file_handle = fopen($file, "rb");
  71.     while (!feof($file_handle)) {
  72.         $line_of_text = fgets($file_handle);
  73.         $parts = explode('\n', $line_of_text);
  74.         if (!empty($parts[0])) {
  75.             $specs = explode(',', trim($parts[0]));
  76.             $formstart = Indent(5) . "<td>\n" . Indent(6) . "<form method=\"post\" action=\"/BTList.php\">\n";
  77.             $formend = Indent(6) . "</form>\n" . Indent(5) . "</td>\n";
  78.             print Indent(4) . "<tr>\n";
  79.             print Indent(5) . "<td>\n";
  80.             print Indent(6) . "<code onmouseover=\"this.style='color:red;'\" onmouseout=\"this.style=''\" onclick=\"document.getElementById('BID').value = this.innerHTML;\">" . $specs[0] . "</code>\n";
  81.             print Indent(5) . "</td>\n";
  82.  
  83.             $char = $ychar;
  84.             if ($specs[1] == 1) {
  85.                 $char = $nchar;
  86.             }
  87.             print $formstart;
  88.             print Indent(7) . "<input type=\"hidden\" name=\"BID\" id=\"BID\" value=\"" . $specs[0] . "\">\n";
  89.             if (!$specs[1]) {
  90.                 print Indent(7) . "<input type=\"hidden\" name=\"AV\" id=\"AV\" value=\"1\">\n";
  91.             }
  92.             if ($specs[2]) {
  93.                 print Indent(7) . "<input type=\"hidden\" name=\"AC\" id=\"AC\" value=\"1\">\n";
  94.             }
  95.             if ($specs[3]) {
  96.                 print Indent(7) . "<input type=\"hidden\" name=\"CM\" id=\"CM\" value=\"1\">\n";
  97.             }
  98.             if ($specs[4]) {
  99.                 print Indent(7) . "<input type=\"hidden\" name=\"AT\" id=\"AT\" value=\"1\">\n";
  100.             }
  101.             print Indent(7) . "<input type=\"submit\" value=\"" . $char . "\">\n";
  102.             print $formend;
  103.  
  104.             $char = $ychar;
  105.             if ($specs[2] == 1) {
  106.                 $char = $nchar;
  107.             }
  108.             print $formstart;
  109.             print Indent(7) . "<input type=\"hidden\" name=\"BID\" id=\"BID\" value=\"" . $specs[0] . "\">\n";
  110.             if ($specs[1]) {
  111.                 print Indent(7) . "<input type=\"hidden\" name=\"AV\" id=\"AV\" value=\"1\">\n";
  112.             }
  113.             if (!$specs[2]) {
  114.                 print Indent(7) . "<input type=\"hidden\" name=\"AC\" id=\"AC\" value=\"1\">\n";
  115.             }
  116.             if ($specs[3]) {
  117.                 print Indent(7) . "<input type=\"hidden\" name=\"CM\" id=\"CM\" value=\"1\">\n";
  118.             }
  119.             if ($specs[4]) {
  120.                 print Indent(7) . "<input type=\"hidden\" name=\"AT\" id=\"AT\" value=\"1\">\n";
  121.             }
  122.             print Indent(7) . "<input type=\"submit\" value=\"" . $char . "\">\n";
  123.             print $formend;
  124.  
  125.             $char = $ychar;
  126.             if ($specs[3] == 1) {
  127.                 $char = $nchar;
  128.             }
  129.             print $formstart;
  130.             print Indent(7) . "<input type=\"hidden\" name=\"BID\" id=\"BID\" value=\"" . $specs[0] . "\">\n";
  131.             if ($specs[1]) {
  132.                 print Indent(7) . "<input type=\"hidden\" name=\"AV\" id=\"AV\" value=\"1\">\n";
  133.             }
  134.             if ($specs[2]) {
  135.                 print Indent(7) . "<input type=\"hidden\" name=\"AC\" id=\"AC\" value=\"1\">\n";
  136.             }
  137.             if (!$specs[3]) {
  138.                 print Indent(7) . "<input type=\"hidden\" name=\"CM\" id=\"CM\" value=\"1\">\n";
  139.             }
  140.             if ($specs[4]) {
  141.                 print Indent(7) . "<input type=\"hidden\" name=\"AT\" id=\"AT\" value=\"1\">\n";
  142.             }
  143.             print Indent(7) . "<input type=\"submit\" value=\"" . $char . "\">\n";
  144.             print $formend;
  145.  
  146.             $char = $ychar;
  147.             if ($specs[4] == 1) {
  148.                 $char = $nchar;
  149.             }
  150.             print $formstart;
  151.             print Indent(7) . "<input type=\"hidden\" name=\"BID\" id=\"BID\" value=\"" . $specs[0] . "\">\n";
  152.             if ($specs[1]) {
  153.                 print Indent(7) . "<input type=\"hidden\" name=\"AV\" id=\"AV\" value=\"1\">\n";
  154.             }
  155.             if ($specs[2]) {
  156.                 print Indent(7) . "<input type=\"hidden\" name=\"AC\" id=\"AC\" value=\"1\">\n";
  157.             }
  158.             if ($specs[3]) {
  159.                 print Indent(7) . "<input type=\"hidden\" name=\"CM\" id=\"CM\" value=\"1\">\n";
  160.             }
  161.             if (!$specs[4]) {
  162.                 print Indent(7) . "<input type=\"hidden\" name=\"AT\" id=\"AT\" value=\"1\">\n";
  163.             }
  164.             print Indent(7) . "<input type=\"submit\" value=\"" . $char . "\">\n";
  165.             print $formend;
  166.  
  167.             print $formstart;
  168.             print Indent(7) . "<input type=\"hidden\" name=\"DID\" id=\"DID\" value=\"" . $specs[0] . "\">\n";
  169.             print Indent(7) . "<input type=\"submit\" value=\"&#128701;\">\n";
  170.             print $formend;
  171.             print Indent(4) . "</tr>\n";
  172.         }
  173.     }
  174.     fclose($file_handle);
  175.     print Indent(3) . "</table>\n" . Indent(2) . "</div>\n";
  176.  
  177.     $file = "./wordlist.txt";
  178.     print Indent(2) . "<div class=\"blocked-words\">\n";
  179.     print Indent(3) . "<h2>Blocked Language</h2>\n";
  180.     $file_handle = fopen($file, "rb");
  181.     $first = 0;
  182.     while (!feof($file_handle)) {
  183.         $line_of_text = fgets($file_handle);
  184.         $parts = explode('\n', $line_of_text);
  185.         if (!empty($parts[0])) {
  186.             if ($first != 0) {
  187.                 print "<br>\n";
  188.             }
  189.             print Indent(3) . "<span>" . trim($parts[0]) . "</span>\n";
  190.             print Indent(3) . "<form method=\"post\" action=\"/BTList.php\">\n";
  191.             print Indent(4) . "<input type=\"hidden\" name=\"DWD\" id=\"DWD\" value=\"" . trim($parts[0]) . "\">\n";
  192.             print Indent(4) . "<input type=\"submit\" value=\"&#128701;\">\n";
  193.             print Indent(3) . "</form>";
  194.             $first = $first + 1;
  195.         }
  196.     }
  197.     fclose($file_handle);
  198.     print "\n" . Indent(2) . "</div>\n";
  199. }
  200.  
  201. if (isset($_REQUEST["BID"])) {
  202.     $file = "./blocklist.txt";
  203.     Top();
  204.     $ID = $_REQUEST["BID"];
  205.     if (!empty($ID)) {
  206.         $av = 0;
  207.         $ac = 0;
  208.         $cm = 0;
  209.         $at = 0;
  210.         if (isset($_REQUEST["AV"]))
  211.             $av = 1;
  212.         if (isset($_REQUEST["AC"]))
  213.             $ac = 1;
  214.         if (isset($_REQUEST["CM"]))
  215.             $cm = 1;
  216.         if (isset($_REQUEST["AT"]))
  217.             $at = 1;
  218.         $IDO = $ID . "," . $av . "," . $ac . "," . $cm . "," . $at . "\n";
  219.         $exists = 0;
  220.         $file_handle = fopen($file, "rb");
  221.         while (!feof($file_handle)) {
  222.             $line_of_text = fgets($file_handle);
  223.             $parts = explode('\n', $line_of_text);
  224.             if (!empty($parts[0])) {
  225.                 $specs = explode(',', $parts[0]);
  226.                 if ($specs[0] == $ID) {
  227.                     $exists = 1;
  228.                     $stored = file_get_contents($file);
  229.                     $stored = str_replace($parts[0], $IDO, $stored);
  230.                     file_put_contents($file, $stored);
  231.                 }
  232.             }
  233.         }
  234.         fclose($file_handle);
  235.         if ($exists == 0)
  236.             file_put_contents($file, $IDO, FILE_APPEND | LOCK_EX) or die('File Write Failure. ".$file ." Ensure the file exists and has correct permissions. (chmod a+w)');
  237.     }
  238.     Content();
  239.     Bottom();
  240. } elseif (isset($_REQUEST["BWD"])) {
  241.     $file = "./wordlist.txt";
  242.     Top();
  243.     $WD = $_REQUEST["BWD"];
  244.     if (!empty($WD)) {
  245.         $WD = $WD . "\n";
  246.         file_put_contents($file, $WD, FILE_APPEND | LOCK_EX) or die('File Write Failure. ".$file ." Ensure the file exists and has correct permissions. (chmod a+w)');
  247.     }
  248.     Content();
  249.     Bottom();
  250. } elseif (isset($_REQUEST["DID"])) {
  251.     $file = "./blocklist.txt";
  252.     Top();
  253.     $del = $_REQUEST["DID"];
  254.     if (!empty($del)) {
  255.         $exists = 0;
  256.         $file_handle = fopen($file, "rb");
  257.         while (!feof($file_handle)) {
  258.             $line_of_text = fgets($file_handle);
  259.             $parts = explode('\n', $line_of_text);
  260.             if (!empty($parts[0])) {
  261.                 $specs = explode(',', $parts[0]);
  262.                 if ($specs[0] == $del) {
  263.                     $stored = file_get_contents($file);
  264.                     $stored = str_replace($parts[0], "", $stored);
  265.                     file_put_contents($file, $stored);
  266.                 }
  267.             }
  268.         }
  269.         fclose($file_handle);
  270.     }
  271.     Content();
  272.     Bottom();
  273. } elseif (isset($_REQUEST["DWD"])) {
  274.     $file = "./wordlist.txt";
  275.     Top();
  276.     $del = trim($_REQUEST["DWD"]) . "\n";
  277.     if (!empty($del)) {
  278.         $exists = 0;
  279.         $file_handle = fopen($file, "rb");
  280.         while (!feof($file_handle)) {
  281.             $line_of_text = fgets($file_handle);
  282.             $parts = explode('\n', $line_of_text);
  283.             if (!empty($parts[0])) {
  284.                 if ($parts[0] == $del) {
  285.                     $stored = file_get_contents($file);
  286.                     $stored = str_replace($parts[0], "", $stored);
  287.                     file_put_contents($file, $stored);
  288.                 }
  289.             }
  290.         }
  291.         fclose($file_handle);
  292.     }
  293.     Content();
  294.     Bottom();
  295. } elseif (isset($_GET["Raw"])) {
  296.     $file = "./blocklist.txt";
  297.     print "[Adblock Plus 3.1]\n";
  298.     print "!Expires: 1 hours (update frequency)\n";
  299.     print "!Homepage: https://linuxhost/BTList.php\n";
  300.     print "!Title: Bitchute Blocklist\n";
  301.     print "!Specifically Blocked Users:\n";
  302.     $file_handle = fopen($file, "rb");
  303.     while (!feof($file_handle)) {
  304.         $line_of_text = fgets($file_handle);
  305.         $parts = explode('\n', $line_of_text);
  306.         if (!empty($parts[0])) {
  307.             $specs = explode(',', trim($parts[0]));
  308.             if ($specs[1])
  309.                 print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-has(> div.comment-header > span.name[data-user-id=\"" . trim($specs[0]) . "\"]) > div.profile-picture\n";
  310.             if ($specs[2])
  311.                 print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-has(> div.comment-header > span.name[data-user-id=\"" . trim($specs[0]) . "\"]) > div.wrapper > span.actions\n";
  312.             if ($specs[3])
  313.                 print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-has(> div.comment-header > span.name[data-user-id=\"" . trim($specs[0]) . "\"]) > div.wrapper > div.content\n";
  314.             if ($specs[4])
  315.                 print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-has(> div.comment-header > span.name[data-user-id=\"" . trim($specs[0]) . "\"]) > div.wrapper > div.attachments\n";
  316.         }
  317.     }
  318.     fclose($file_handle);
  319.     print "!Generally Blocked Language:\n";
  320.     $file = "./wordlist.txt";
  321.     $file_handle = fopen($file, "rb");
  322.     while (!feof($file_handle)) {
  323.         $line_of_text = fgets($file_handle);
  324.         $parts = explode('\n', $line_of_text);
  325.         if (!empty($parts[0])) {
  326.             print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.wrapper > div.attachments\n";
  327.             print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.wrapper > span.actions\n";
  328.             print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.wrapper > div.content\n";
  329.             print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.profile-picture\n";
  330.         }
  331.     }
  332.     fclose($file_handle);
  333. } else {
  334.     Top();
  335.     Content();
  336.     Bottom();
  337. }
Add Comment
Please, Sign In to add comment