Nokakin

チャンネル動画の検索結果から有料動画を消すやつ

  1. // ==UserScript==
  2. // @name Nokakin
  3. // @namespace https://github.com/segabito/
  4. // @description チャンネル動画の検索結果から有料動画を消すやつ
  5. // @include *://ch.nicovideo.jp/search/*
  6. // @version 2.3.9
  7. // @grant none
  8. // @license Public Domain
  9. // @noframes
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. var monkey =
  14. (function() {
  15. var addStyle = function(styles, id) {
  16. var elm = document.createElement('style');
  17. elm.type = 'text/css';
  18. if (id) { elm.id = id; }
  19.  
  20. var text = styles.toString();
  21. text = document.createTextNode(text);
  22. elm.appendChild(text);
  23. var head = document.getElementsByTagName('head');
  24. head = head[0];
  25. head.appendChild(elm);
  26. return elm;
  27. };
  28.  
  29. addStyle(`
  30. .popular {
  31. background: #ffc !important;
  32. }
  33.  
  34. .popular2 {
  35. outline: 2px solid gold !important;
  36. outline-offset: -4px;
  37. }
  38.  
  39. .popular3 {
  40. font-weight: bolder !important;
  41. color: red;
  42. }
  43.  
  44. .contents_list.video.detail .items {
  45. }
  46. `.trim(), 'Nokakin');
  47.  
  48.  
  49.  
  50. var update = function() {
  51. Array.apply(null, document.querySelectorAll('.ads')).forEach(function(elm) {
  52. elm.remove();
  53. });
  54.  
  55. //Array.apply(null, document.querySelectorAll('.ppv:not(.member_unlimited_access)')).forEach(function(ppv) {
  56. Array.apply(null, document.querySelectorAll('.ppv:not(.member_unlimited_access)')).forEach(function(ppv) {
  57. ppv.closest('.item').remove();
  58. });
  59.  
  60. //Array.apply(null, document.querySelectorAll('.item_right .title')).forEach(function(title) {
  61. // var item = title.closest('.item');
  62. // var text = title.textContent;
  63. // //window.console.log('title:', text, item);
  64. // //if (maybeNg.test(text)) {
  65. // // item.style.opacity = 0.5;
  66. // //}
  67. // //if (ng.test(text)) {
  68. // // item.style.display = 'none';
  69. // //}
  70. //});
  71.  
  72.  
  73. Array.apply(null, document.querySelectorAll('.item .comment var')).forEach(function(elm) {
  74. var item = elm.closest('.item');
  75. var numRes = parseInt((elm.textContent || '0').replace(/,/g, ''), 10);
  76. //window.console.log('numRes:', numRes, item);
  77. if (numRes < 5) {
  78. //item.style.display = 'none';
  79. }
  80. if (numRes > 1000) {
  81. item.classList.add('popular');
  82.  
  83. }
  84. if (numRes > 5000) {
  85. item.classList.add('popular2');
  86. }
  87. if (numRes > 10000) {
  88. item.classList.add('popular2');
  89. item.classList.add('popular3');
  90. }
  91. });
  92. };
  93.  
  94. window.setTimeout(update, 0);
  95.  
  96. document.body.addEventListener('AutoPagerize_DOMNodeInserted', update, false);
  97. }); // end of monkey
  98.  
  99. window.setTimeout(monkey, 0);
  100. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址