5chExtendr / 5chTubeVideoThread#

// ==UserScript==
// @license     MIT
// @author      5chTubeExtender
// @name        5chTubeVideoThread#
// @namespace   Violentmonkey Tiesto Scripts
// @match       *://*.5ch.net/*
// @exclude     *://find.5ch.net/*
// @run-at      document-end
// @grant       none
// @version             2026/03/15
// @description Version 2026/03/15
// @icon   https://cdn-icons-png.flaticon.com/64/2504/2504965.png
// ==/UserScript==

// Must install Extentions [AdGuard],[Violentmoky],[Usar-Agent Switcher]
// Must install [5chTubeVideoThread#],[5chTubeVideoBoard#] ,[5chTueVideoMenu#],[5chTubezExtender#]
// https://openuserjs.org/users/5chExtendr/scripts
// Go 5ch.net URL→https://menu.5ch.net/bbstable.html?v=pc



if(0){d=document.body.innerHTML;alert(d);}



(function(){lh=location.href;lhs=lh.split('/');if(lh.indexOf('/test/read.cgi/')>0){
Tlh='https://'+lhs[2]+'/'+lhs[5];}else{Tlh='https://'+lhs[2]+'/'+lhs[3];}
if(lh.indexOf('//uplift.')>0){window.history.go(-3);}

ytlink='<br><a href=https://www.youtube.com/watch?v=$3 target=_blank><b>https://youtube.com/watch?v=$3</b></a>';

h=document.head.innerHTML;h+='<style>div[div="thumbbbs"],div[div="thumbBBS"],img.thumb_i{display:none!important;}'+
'div[div="thumb5ch"],#announcement,.table_info{display:none !important;}klog_view{background:#bbcced!important;}center > p,center > table[cellspacing="5"],div.ad--right,div.js--ad--right--top,div.js--ad--right--bottom,div.js--ad--bottom,div#bbspink-bottom-ads,div.bbspink-top-ads,body > div.box,body > div.lbox,iframe#google_esf{display:none !important;}'+
'body{z-index:99998!important} html,body,div,span,table,fream,font,a,b,wbr,small{background:none!important;background-color:#bbcced!important;}input,textarea{bacground-color:#ffffff!important;}'+
'frame{display:none!important;}</style>';document.head.innerHTML=h;
lh=location.href;
if(lh.indexOf('//menu.')>0){;}else{mode=0;
if((mode)||(lh.indexOf('/test/read.cgi/')>0)){videos='/';vcnt=0;vls='';s=1;
d=document.body.innerHTML;tx=d.replace(/(youtt?ube\.com\/watch\?v\=|you●?tt?u\.be\/|ytimg\.com\/vi\/)([\d\w\_\-]{11})/img,'youtube.com/embed/$2 ');
if((txn=tx.indexOf('/embed/'))>1){tbx=tx.split('/embed/');tbxn=tbx.length;if(tbxn>0){for(tbxi=1;tbxi<=tbxn;tbxi++){
w=tbx[tbxi];if(w!=undefined){w=w.substr(0,11).replace(/([^\d\w\_\-])/img,'')+'/';if(12==w.length){
vls=w+vls.replace(w,'');vcnt++;videos=w+videos.replace(w,'').replace('undefined/','').replace('//','/');}}
}}}vcnt=vls.split('/').length-1;video=videos.replace('undefined/','').replace('//','/');
c=document.cookie.split(';');for(i=0;i<c.length;i++){if(c[i].indexOf('video=')>0){incookie=c[i].split('video=')[1].split('$')[0];videos+=incookie;break;}}

videos=videos.replace(/(\/\/+)/img,'/');
v=videos.split('/');for(i=0;i<v.length-1;i++){w=v[i].replace(/([^\d\w\_\-])/img,'')+'/';if(w.length==12){videos=w+videos.replace(w,'').replace(w,'').replace(w,'');}else if(w!='/'){videos=videos.replace(w,'')}}
Link=',link='+encodeURIComponent('<a href='+location.href.split('?')[0].split('#')[0]+'?v=pc target=_top>☆'+document.title+'</a><br>');
TlhV=Tlh+'/?v=pc#video='+videos.split('/').join('%')+'$'+Link;
MlhV='https://menu.5ch.net/bbstable.html?v=pc#video='+videos.split('/').join('%')+'$'+Link;

document.cookie='name=;';document.cookie='name=video='+videos+'$;';

d=document.body.innerHTML;
d=d.split('<textarea').join('<textarea style=background-color:#fff!important;width:90%!important;height:150px; ');
d=d.split('<input').join('<input style=background-color:#fff!important;color:#000!important;width:320px!important; ');
d=d.replace(/( ?z\-index\: ?\d+)/img,' ;display:none!important; ').replace(/(<script )([^<]+)(<\/script>)/img,'');
d=d.replace('//://','://').replace(/(jump\.5ch\.net\/\%20)/ig,'').replace(/(<a [^>]+>)/img,'').replace(/(<\/a>)/img,'').replace(/(<img [^>\n]+>)/img,'').replace(/(https?)/img,'');
d=d.replace(/(:?\/\/[^\/]+[^\.]+\.)(jpeg|bmp|jpg|gif|gifv|png|webp|ico|svg|svgz)/img,'<br><immg style=max-width:800px; src=https$1$2>');
d=d.replace(/(pp|si|[^y]list|!playlist)(\=[^<]+)/img,'');
d=d.replace(/(\.be\/|\/watch|embed\/)([^><  \n\"\']+)/img,'$1$2#');
d=d.replace(/(\/?\/?:?\/\/www\.|\/?\/?:?\/\/m\.|\/?\/?:?\/\/i\.|\/?\/?:?\/\/i\d\.|:?\/\/|)(youtt?ube\.com\/watch\?v\=|you●?tt?u\.be\/|youtt?ube\.com\/embed\/|youtt?ube\/embed\/|ytimg\.com\/vi\/)([\d\w\_\_\-]{11})([^<\n]+)/img,
//'<br><input style=width:320px;height:26px;background-color:#fff;color:#000;border:0px;border-collor:black;margin:0px!important; value="https://youtube.com/embed/$3$4">
ytlink+'<br><a href="https://youtube.com/embed/$3$4" target=_blank><img src=https://i.ytimg.com/vi/$3/mqdefault.jpg></a><br><form style=display:inline;height:26px; method=get target=_blank action=https://www.youtube.com/results accept-charset=utf-8><input style=margin:0px!important;background:#fff;width:180px; name=search_query type=text value=""><input style=background-color:#fff!important;color:#000!important; type=reset value=クリア><input style=background-color:#fff!important;color:#000!important; type=submit value= 検索 ></form><br>'+
'<input style=width:110px;height:26px;background-color:#fff!important;color:#000!important; type=button onclick=";window.open(MlhV,(\'_top\'));" value=5ch板一覧><input style=width:100px;height:26px;background-color:#fff!important;color:#000!important; type=button onclick=";window.open(TlhV,(\'_top\'));" value=板トップ><input style=width:110px;height:26px;background-color:#fff!important;color:#000!important; type=button onclick=";window.open(Tlh+(\'/subback.html?v=pc\'),(\'_top\'));" value=スレッド一覧><br>');
d=d.replace(/(\/embed\/)([\d\w\_\-]+)(\&amp;?t\=\d+s?|\&amp;?)/img,'$1$2');
document.body.innerHTML=d;}}

noage18=1;lh=location.href;
if(lh.indexOf('//menu.')>0){if(noage18){
d=document.body.innerHTML;
dd=d.split('bbspink').join('@age18');
d=dd.replace(/(\/ ?<a [^@]+)(@age18[^<]+)(<\/a>)/img,'').replace('@age18','bspink');
document.body.innerHTML=d;}}


lh=location.href;if(lh.indexOf('subback')>0){tx=document.getElementsByTagName('a');
for(i=0;i<tx.length;i++){tx[i].href=tx[i].href.split('?')[0].split('#')[0]+'?v=pc';
if(tx[i].innerHTML.indexOf('</b>')>0){;}else{
tx[i].innerHTML='<b style=font-size:16px;>'+tx[i].innerHTML+'</b>';}}}

lh=location.href;if(lh.indexOf('//menu.')>0){wn=2;
tx=document.getElementsByTagName('a');if(document.body.innerHTML.indexOf('DJ・')>0){
for(i=0;i<tx.length;i++){sv=tx[i].href.split('/')[2].split('.')[0];
if(('|www|5ch|headline|uplift|itest|dig|find|stat|o|rio2016|medaka|kes|egg|fate|').indexOf(sv)>=0){ck='';sv=sv.substr(0,wn)+':';sv=''}else{ck='';sv='';}
sn='000'+i;sn=sn.substr(sn.length-3,3);svx=sn+','+sv;tx[i].innerHTML='<b style=font-size:16px;>'+sv+ck+tx[i].innerHTML.replace('・','-')+'</b>';
tx[i].href=tx[i].href.split('?')[0].split('#')[0]+'?v=pc';}}}
  ;;;})()