IrascibleMe

Bitchute Blocklist V2

Aug 29th, 2020 (edited)
158
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 Top()
  3. {
  4.         print "<!DOCTYPE html>\n";
  5.         print "<html>\n";
  6.         print "\t<head>\n";
  7.         print "\t\t<meta charset=\"UTF-8\">\n";
  8.         print "\t\t<title>Bitchute Blocklist</title>\n";
  9.         print "\t</head>\n";
  10.         print "\t<body>\n";
  11.         print "\t\t<h1>Bitchute Blocklist</h1>\n";
  12.         print "\t\t<div class=\"form-block-user\">\n";
  13.         print "\t\t\t<h2>User Blocking</h2>\n";
  14.         print "\t\t\t<form method=\"post\" action=\"/BTList.php\">\n";
  15.         print "\t\t\t\t<input type=\"checkbox\" id=\"AV\" name=\"AV\" value=\"1\" checked=\"1\" title=\"Block User Avatar\">\n";
  16.         print "\t\t\t\t<label for=\"AV\" title=\"Block User Avatar\">Avatar</label>\n";
  17.         print "\t\t\t\t<input type=\"checkbox\" id=\"AC\" name=\"AC\" value=\"1\" checked=\"1\" title=\"Block User Actions Bar\">\n";
  18.         print "\t\t\t\t<label for=\"AC\" title=\"Block User Actions Bar\">Actions</label>\n";
  19.         print "\t\t\t\t<input type=\"checkbox\" id=\"CM\" name=\"CM\" value=\"1\" checked=\"1\" title=\"Block User Comments\">\n";
  20.         print "\t\t\t\t<label for=\"CM\" title=\"Block User Comments\">Comments</label>\n";
  21.         print "\t\t\t\t<input type=\"checkbox\" id=\"AT\" name=\"AT\" value=\"1\" checked=\"1\" title=\"Block User Attachments\">\n";
  22.         print "\t\t\t\t<label for=\"AT\" title=\"Block User Attachments\">Attachments</label><br>\n";
  23.         print "\t\t\t\t<label for=\"BID\" title=\"data-user-id To Block\">ID to block:</label>\n";
  24.         print "\t\t\t\t<input type=\"text\" id=\"BID\" name=\"BID\" value=\"\" title=\"data-user-id To Block\">\n";
  25.         print "\t\t\t\t<input type=\"submit\" value=\"&#127988;\">\n";
  26.         print "\t\t\t</form>\n";
  27.         print "\t\t</div>\n";
  28.         print "\t\t<div class=\"form-block-word\">\n";
  29.         print "\t\t\t<h2>Language Blocking</h2>\n";
  30.         print "\t\t\t<form method=\"post\" action=\"/BTList.php\">\n";
  31.         print "\t\t\t\t<label for=\"BWD\">Word(s) to block:</label>\n";
  32.         print "\t\t\t\t<input type=\"text\" id=\"BWD\" name=\"BWD\" value=\"\">\n";
  33.         print "\t\t\t\t<input type=\"submit\" value=\"&#127988;\">\n\t\t\t</form>\n\t\t</div>\n";
  34. }
  35.  
  36. function Bottom()
  37. {
  38.         print "\t</body>\n";
  39.         print "</html>";
  40. }
  41.  
  42. function Content()
  43. {
  44.         $file = "./blocklist.txt";
  45.         print "\t\t<div class=\"blocked-users\">\n";
  46.         print "\t\t\t<h2>Blocked Users</h2>\n";
  47.         print "\t\t\t<table>\n";
  48.         print "\t\t\t\t<tr>\n";
  49.         print "\t\t\t\t\t<th>ID</th>\n";
  50.         print "\t\t\t\t\t<th>AV</th>\n";
  51.         print "\t\t\t\t\t<th>AC</th>\n";
  52.         print "\t\t\t\t\t<th>CM</th>\n";
  53.         print "\t\t\t\t\t<th>AT</th>\n";
  54.         print "\t\t\t\t\t<th>Del</th>\n";
  55.         print "\t\t\t\t</tr>\n";
  56.         $nchar = "&#128405;";
  57.         $ychar = "&#128077;";
  58.         $file_handle = fopen($file, "rb");
  59.         while (!feof($file_handle)) {
  60.                 $line_of_text = fgets($file_handle);
  61.                 $parts = explode('\n', $line_of_text);
  62.                 if (!empty($parts[0])) {
  63.                         $specs = explode(',', trim($parts[0]));
  64.                         print "\t\t\t\t<tr>\n";
  65.                         print "\t\t\t\t\t<td><code>" . $specs[0] . "</code></td>\n";
  66.                         $char = $ychar;
  67.                         if ($specs[1] == 1) {
  68.                                 $char = $nchar;
  69.                         }
  70.                         print "\t\t\t\t\t<td>" . $char . "</td>\n";
  71.                         $char = $ychar;
  72.                         if ($specs[2] == 1) {
  73.                                 $char = $nchar;
  74.                         }
  75.                         print "\t\t\t\t\t<td>" . $char . "</td>\n";
  76.                         $char = $ychar;
  77.                         if ($specs[3] == 1) {
  78.                                 $char = $nchar;
  79.                         }
  80.                         print "\t\t\t\t\t<td>" . $char . "</td>\n";
  81.                         $char = $ychar;
  82.                         if ($specs[4] == 1) {
  83.                                 $char = $nchar;
  84.                         }
  85.                         print "\t\t\t\t\t<td>" . $char . "</td>\n";
  86.                         print "\t\t\t\t\t<td>\n";
  87.                         print "\t\t\t\t\t\t<form method=\"post\" action=\"/BTList.php\">\n";
  88.                         print "\t\t\t\t\t\t\t<input type=\"hidden\" name=\"DID\" id=\"DID\" value=\"" . $specs[0] . "\">\n";
  89.                         print "\t\t\t\t\t\t\t<input type=\"submit\" value=\"&#128701;\">\n";
  90.                         print "\t\t\t\t\t\t</form>\n";
  91.                         print "\t\t\t\t\t</td>\n";
  92.                         print "\t\t\t\t</tr>\n";
  93.                 }
  94.         }
  95.         fclose($file_handle);
  96.         print "\t\t\t</table>\n\t\t</div>\n";
  97.  
  98.         $file = "./wordlist.txt";
  99.         print "\t\t<div class=\"blocked-words\">\n";
  100.         print "\t\t\t<h2>Blocked Language</h2>\n";
  101.         $file_handle = fopen($file, "rb");
  102.         $first = 0;
  103.         while (!feof($file_handle)) {
  104.                 $line_of_text = fgets($file_handle);
  105.                 $parts = explode('\n', $line_of_text);
  106.                 if (!empty($parts[0])) {
  107.                         if ($first != 0) {
  108.                                 print "<br>\n";
  109.                         }
  110.                         print "\t\t\t<span>" . trim($parts[0]) . "</span><form method=\"post\" action=\"/BTList.php\"><input type=\"hidden\" name=\"DWD\" id=\"DWD\" value=\"" . trim($parts[0]) . "\"><input type=\"submit\" value=\"&#128701;\"></form>";
  111.                         $first = $first + 1;
  112.                 }
  113.         }
  114.         fclose($file_handle);
  115.         print "\n\t\t</div>\n";
  116. }
  117.  
  118. if (isset($_REQUEST["BID"])) {
  119.         $file = "./blocklist.txt";
  120.         Top();
  121.         $ID = $_REQUEST["BID"];
  122.         if (!empty($ID)) {
  123.                 $av = 0;
  124.                 $ac = 0;
  125.                 $cm = 0;
  126.                 $at = 0;
  127.                 if (isset($_REQUEST["AV"]))
  128.                         $av = 1;
  129.                 if (isset($_REQUEST["AC"]))
  130.                         $ac = 1;
  131.                 if (isset($_REQUEST["CM"]))
  132.                         $cm = 1;
  133.                 if (isset($_REQUEST["AT"]))
  134.                         $at = 1;
  135.                 $IDO = $ID . "," . $av . "," . $ac . "," . $cm . "," . $at . "\n";
  136.                 $exists = 0;
  137.                 $file_handle = fopen($file, "rb");
  138.                 while (!feof($file_handle)) {
  139.                         $line_of_text = fgets($file_handle);
  140.                         $parts = explode('\n', $line_of_text);
  141.                         if (!empty($parts[0])) {
  142.                                 $specs = explode(',', $parts[0]);
  143.                                 if ($specs[0] == $ID) {
  144.                                         $exists = 1;
  145.                                         $stored = file_get_contents($file);
  146.                                         $stored = str_replace($parts[0], $IDO, $stored);
  147.                                         file_put_contents($file, $stored);
  148.                                 }
  149.                         }
  150.                 }
  151.                 fclose($file_handle);
  152.                 if ($exists == 0)
  153.                         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)');
  154.         }
  155.         Content();
  156.         Bottom();
  157. } elseif (isset($_REQUEST["BWD"])) {
  158.         $file = "./wordlist.txt";
  159.         Top();
  160.         $WD = $_REQUEST["BWD"];
  161.         if (!empty($WD)) {
  162.                 $WD = $WD . "\n";
  163.                 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)');
  164.         }
  165.         Content();
  166.         Bottom();
  167. } elseif (isset($_REQUEST["DID"])) {
  168.         $file = "./blocklist.txt";
  169.         Top();
  170.         $del = $_REQUEST["DID"];
  171.         if (!empty($del)) {
  172.                 $exists = 0;
  173.                 $file_handle = fopen($file, "rb");
  174.                 while (!feof($file_handle)) {
  175.                         $line_of_text = fgets($file_handle);
  176.                         $parts = explode('\n', $line_of_text);
  177.                         if (!empty($parts[0])) {
  178.                                 $specs = explode(',', $parts[0]);
  179.                                 if ($specs[0] == $del) {
  180.                                         $stored = file_get_contents($file);
  181.                                         $stored = str_replace($parts[0], "", $stored);
  182.                                         file_put_contents($file, $stored);
  183.                                 }
  184.                         }
  185.                 }
  186.                 fclose($file_handle);
  187.         }
  188.         Content();
  189.         Bottom();
  190. } elseif (isset($_REQUEST["DWD"])) {
  191.         $file = "./wordlist.txt";
  192.         Top();
  193.         $del = trim($_REQUEST["DWD"]) . "\n";
  194.         if (!empty($del)) {
  195.                 $exists = 0;
  196.                 $file_handle = fopen($file, "rb");
  197.                 while (!feof($file_handle)) {
  198.                         $line_of_text = fgets($file_handle);
  199.                         $parts = explode('\n', $line_of_text);
  200.                         if (!empty($parts[0])) {
  201.                                 if ($parts[0] == $del) {
  202.                                         $stored = file_get_contents($file);
  203.                                         $stored = str_replace($parts[0], "", $stored);
  204.                                         file_put_contents($file, $stored);
  205.                                 }
  206.                         }
  207.                 }
  208.                 fclose($file_handle);
  209.         }
  210.         Content();
  211.         Bottom();
  212. } elseif (isset($_GET["Raw"])) {
  213.         $file = "./blocklist.txt";
  214.         print "[Adblock Plus 3.1]\n";
  215.         print "!Expires: 1 hours (update frequency)\n";
  216.         print "!Homepage: https://linuxhost/BTList.php\n";
  217.         print "!Title: Bitchute Blocklist\n";
  218.         print "!Specifically Blocked Users:\n";
  219.         $file_handle = fopen($file, "rb");
  220.         while (!feof($file_handle)) {
  221.                 $line_of_text = fgets($file_handle);
  222.                 $parts = explode('\n', $line_of_text);
  223.                 if (!empty($parts[0])) {
  224.                         $specs = explode(',', trim($parts[0]));
  225.                         if ($specs[1])
  226.                                 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";
  227.                         if ($specs[2])
  228.                                 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";
  229.                         if ($specs[3])
  230.                                 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";
  231.                         if ($specs[4])
  232.                                 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";
  233.                 }
  234.         }
  235.         fclose($file_handle);
  236.         print "!Generally Blocked Language:\n";
  237.         $file = "./wordlist.txt";
  238.         $file_handle = fopen($file, "rb");
  239.         while (!feof($file_handle)) {
  240.                 $line_of_text = fgets($file_handle);
  241.                 $parts = explode('\n', $line_of_text);
  242.                 if (!empty($parts[0])) {
  243.                         print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.wrapper > div.attachments\n";
  244.                         print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.wrapper > span.actions\n";
  245.                         print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.wrapper > div.content\n";
  246.                         print "bitchute.com#?#li.comment > div.comment-wrapper:-abp-contains(" . trim($parts[0]) . ") > div.profile-picture\n";
  247.                 }
  248.         }
  249.         fclose($file_handle);
  250. } else {
  251.         Top();
  252.         Content();
  253.         Bottom();
  254. }
Add Comment
Please, Sign In to add comment