5chExtendr / 5chTubeVideoChk#

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



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



(function(){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('/test/read.cgi/')>0){
d=document.body.innerHTML.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 [^>]+>)/img,'').replace(/(https?)/img,'');
d=d.replace(/(:?\/\/[^\/]+[^\.]+\.)(jpeg|bmp|jpg|gif|gifv|png|webp|ico|svg|svgz)/img,'<br><img style=max-width:800px; src=https$1$2>');
d=d.replace(/(pp|si|[^y]list|!playlist)(\=[^<]+)/img,'');
d=d.replace(/(\/?\/?:?\/\/www\.|\/?\/?:?\/\/m\.|\/?\/?:?\/\/i\.|\/?\/?:?\/\/i\d\.|:?\/\/|)(youtube\.com\/watch\?v\=|youtu\.be\/|youtube\.com\/embed\/|youtube\/embed\/|ytimg\.com\/vi\/)(MqEBL_PmAtM|[\w\_\_\-]+)([^<]+)/img,
'<br><input style=width:320px;height:26px;background-color:#fff; value="https://youttube.com/embed/$3$4"><br style=height:0px;><a href="https://youtube.com/embed/$3$4" target=_blank><img src=https://i.ytimg.com/vi/$3/mqdefault.jpg></a><br>');
document.body.innerHTML=d;}

lh=location.href;if(lh.indexOf('//menu.')>0){
tx=document.getElementsByTagName('a');if(document.body.innerHTML.indexOf('☆')>0){;}else{
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|').indexOf(sv)>=0){ck='☆';}else{ck='';}
sn='000'+i;sn=sn.substr(sn.length-3,3);sv=sn+','+sv;sv='';tx[i].innerHTML=ck+tx[i].innerHTML;}}}else{if(lh.indexOf('/test/read.cgi/')>0){;}else{
setTimeout("(docti=document.title.split(' -')[0]);VSPARROW=localStorage['VSPARROW'];"+
"if(td=document.body.getElementsByTagName('div')){for(i=td.length-1;i>0;i--){"+
"if((tt=td[i].innerHTML).indexOf('SPARROW')>0){tt=tt+'<center>'+VSPARROW;td[i].innerHTML=tt;break;}}};",3000);}}

dt=document.title+'\n\n';s=0;
lh=location.href;if(lh.indexOf('//menu')>0){;}else{
(docti=document.title.split(' -')[0]);
stv=localStorage[('playlist'+docti)].split('\n\n')[0]+'\n';
if(stv.length<30){stv=localStorage['playlist'].split('\n\n')[0]+'\n';}localStorage[('playlist'+docti)]=stv;
stv=stv.replace(/(youtube\.com\/watch\?v\=|youtu\.be\/|ytimg\.com\/vi\/)([\w\_\-]+)/img,'youtube.com/embed/$2');
localStorage['setlist']=stv+localStorage['setlist'];
plv=stv;if(stv.indexOf('/embed/')>0){tbx=stv.split('/embed/');tbxn=tbx.length;stv='';
limt=10;if(tbxn>limt){tbxn=limt;}if(tbxn>1){for(tbxi=tbxn;tbxi>0;tbxi--){
w=tbx[tbxi];if(w!=undefined){w=w.substr(0,11)+'/';if(12==w.length){
stv=w+stv.replace(w,'');}}}st=stv.split('/');}};stn=st.length-1;
if(0){alert(dt+'YouTube動画再生用 '+stn+'個一括プレイリストを作成します\n\n'+stv);}
v='';for(sti=0;sti<stn;sti++){vs=st[sti];
if(sti>0){if(1==sti){c=','}else{c=','}v=v+c+st[sti];}else{
v='https://youtube.com/embed/'+st[0]+'?playlist='+st[0];}}
window.open(v+'&loop=1&autoplay=1&','_blank');}

lh=location.href;if(1){s=0;
stv=localStorage['setlist'].split('/undefined?')[0].split('\n\n')[0]+'\n';stvx=stv;stv=stv.replace(/(youtube\.com\/watch\?v\=|youtu\.be\/|ytimg\.com\/vi\/)([\w\_\-]+)/img,'youtube.com/embed/$2 ');
if(stv.indexOf('/embed/')>0){tbx=stv.split('/embed/');tbxn=tbx.length;stv='';if(tbxn>1){for(tbxi=tbxn;tbxi>0;tbxi--){
w=tbx[tbxi];if(w!=undefined){w=w.substr(0,11)+'/';if(12==w.length){
stv=w+stv.replace(w,'');}}}st=stv.split('/');}};stn=st.length-1;
if(s){alert(dt+'YouTube動画一覧に '+stn+'個の動画を追加します\n\n'+stv);}
v=localStorage['VideosList'];if(stn>50){v='PO8nT3tuJVY/mCppM9ibEvA/_yLRNzsEcbg/';}
for(sti=0;sti<=stn;sti++){w=st[sti]+'/';if(12==w.length){v=w+v.replace(w,'');}}
localStorage['VideosList']=v;localStorage['setlist']='';};;;})()