// ==UserScript== // @name yahvt // @description yet another html5 video tool // @namespace gnblizz // @include http://anilinkz.tv/* // @include http://www.animeboy.org/* // @include http://www.animecenter.tv/* // @include http://www.animedreaming.tv/* // @include http://anime-exceed.com/* // @include http://www.animefreak.tv/* // @include http://www.animefushigi.com/* // @include http://www.animehere.com/* // @include http://www.animenova.org/* // @include http://www.animenova.tv/* // @include http://www.animeplus.tv/* // @include http://www.animeseason.com/* // @include http://ww1.animes-stream24.net/* // @include http://www.anime-sub.com/* // @include http://www.animetoon.eu/* // @include http://www.animetoon.tv/* // @include http://www.animeultima.io/* // @include http://animewow.eu/* // @include http://www.animewow.eu/* // @include http://bestanimes.tv/* // @include http://www.chia-anime.tv/* // @include http://www.clipfish.de/* // @include http://dramago.com/* // @include http://www.dramago.com/* // @include http://www.dramagalaxy.eu/* // @include http://www.dramagalaxy.com/* // @include http://dubbedanime.net/* // @include http://www.dubzonline.com/* // @include http://freeanime.com/* // @include http://www.gogoanime.com/* // @include http://www.goodanime.eu/* // @include http://www.goodanime.net/* // @include http://www.gooddrama.net/* // @include http://www.kumby.com/* // @include http://www.lovemyanime.net/* // @include http://www.otakucenter.com/* // @include http://www.theanime.tv/* // @include http://www.videozoo.me/* // @include http://www.waoanime.tv/* // @include *newembed* // @include *embed* // @include *gogo/* // @include *widget/* // @include http://player.arkvid.tv/* // @version 1.04 // @grant GM_xmlhttpRequest // @icon data:image/gif;base64,R0lGODlhMAAwAKECAAAAAICAgP///////yH5BAEKAAMALAAAAAAwADAAAALQnI+py+0Po5y02ouz3rz7D4biBJTmiabqyrbuC8fyHAf2jedpzuOvAAwKh6mhUfg7Hks3gHLpehptwIBTioxig0zrdStIgrslMFA8pCKp1oAZjXW6w/Mt/Nl2t8HeFl7o5QZgBagEYyawNxhUl7h4dlelFlZG+QVY6aglmIjjuKd50xla9RKI0mSCqaPJSMM0aEK4mhfbpSnTabM4WXrShtpHI6gqKvmKnCwns0tm2lOsLP3aUy08aK0zvc3d7b09Ei4+Tl5ufo6err7O3n5QAAA7 // @compatible firefox // @downloadURL none // ==/UserScript== "use strict"; var domain = document.domain ? document.domain.match(/^(?:www\.)?(.*)$/)[1] : 'none'; function sites(){ var a,i,o,e,b; switch(domain) { case 'animeseason.com': if(obj('#series_info')) SetStyle('table a:visited{color:gray;}table a:hover{color:#FC0;}'); allowFullscreen('#video_source', '#player_list A'); break; case 'anime-exceed.com': if(!/^\/cool\//.test(location.pathname)) allowFullscreen((window.self==window.top)?'#player':'body'); break; case 'animefreak.tv': i=(a=objs('.multi')).length; if(i)do { o = a[--i]; e = o.getAttribute('onclick'); if(e && /loadParts\('http/.test(e)) o.onclick = function(event) { var vid_file = decodeURIComponent(this.getAttribute('onclick').match(/loadParts\('([^']+)'/)[1]); document.getElementById("player").innerHTML = ''; }; } while(i); break; case 'bestanimes.tv': allowFullscreen('.post'); break; case 'clipfish.de': obj('+SCRIPT', document.body).innerHTML = 'checkMobile=function(){isMobile=true;}'; break; case 'freeanime.com': obj('+SCRIPT', document.body).innerHTML = '$(window).unbind();\n$("#header").css("background-attachment","scroll")'; allowFullscreen('.z-video', 'ul.z-tabs-nav LI', 999); break; case 'videowing.me': case 'videozoo.me': if(!/\bnoflash\b/i.test(location.search)) location.search = location.search ? (location.search+'&noflash') : '?noflash'; case 'player.arkvid.tv': case 'gogoanime.com': return 1; case 'yucache.net': case 'yourupload.com': if(document.URL.match(/[?&]/) == '&') // bad URL? document.location.replace(document.URL.replace('&', '?')); default: return(/\/((?:new)?embed|gogo\/|widget\/)/.test(document.URL)); } function allowFullscreen(video, mirrors, delay) { if(delay) window.setTimeout( function() { allowFullscreen(video, mirrors); }, delay); else { if(mirrors) { var a = document.querySelectorAll(mirrors), i = a.length; if(i) do { a[--i].addEventListener('click', function() { window.setTimeout( function() { document.querySelector(video+' IFRAME').setAttribute('allowfullscreen', 'true'); }, 99); }); } while(i); } var ifr = document.querySelector(video+' IFRAME'); if(ifr) ifr.setAttribute('allowfullscreen', 'true'); else console.log(video+' IFRAME not found in '+document.URL); } }} function findVideoFile() { var s, m, a, i, p; var timer;//videozoo s = obj('VIDEO', document.body); if(s) { m = s.getAttribute('src'); if(m) return m; if((a = obj('SOURCE', s)) && (m = a.getAttribute('src'))) return m; } a = objs('SCRIPT', document.body); i = a.length; if(i) { do { s = getScript(a[--i]); m = s.match(/"(http:\/\/[^"]+\.(?:mp4|flv)\b[^"]*)"/i); if(m) return m[1]; m = s.match(/"(.+\.php\b.+\.(?:mp4|flv))"/i); if(m) return m[1]; m = s.match(/"([^"]+\bpicasa\.php\b[^"]+)"/i); if(m) return m[1]; m = s.match(/"(https\:\/\/[^"]*\.googlevideo\.com\/videoplayback[^"]+)"/i); if(m) return m[1]; m = s.match(/"(https\:\/\/[^"]*\.googleusercontent.com\/[^"]+)"/i); if(m) return m[1]; } while(i); i = a.length; // videonest.net code removed, due to exception 403008 } if(/trollvid\.net$/i.test(domain)) { if(i) do { s = a[--i].innerHTML; m = s.match(/['"](http.*data.*file.*)['"]/i); if(m) return m[1]; } while(i); a = objs('SCRIPT', document.head); i = a.length; if(i) do { s = a[--i].innerHTML; m = s.match(/unescape\(atob\('(.*)'/i); if(m) { m = unescape(atob(m[1])); if(/\.(mp4|flv)/i.test(m)) return m;} } while(i); } else if('videobam.com' == domain) { if(i) do { s = a[--i].innerHTML; m = s.match(/['"](http:\\\/\\\/[^'"]+\.(?:mp4|flv)\b[^'"]*)['"]/i); if(m) return m[1].replace(/\\\//g,'/'); } while(i); i = a.length; } a = objs('PARAM'); i = a.length; if(i) do { p = a[--i].getAttribute('value'); m = p.match(/video=(http:\/\/[^'"]+\.mp4[^'"&]*)/i); if(m) return m[1]; } while(i); a = objs('EMBED'); i = a.length; if(i) do { p = a[--i].getAttribute('src'); m = p.match(/video=(http:\/\/[^'"]+\.mp4[^'"&]*)/i); if(m) return m[1]; } while(i); function getScript(s) { return unescape(s.innerHTML.replace(/\s\/\/.*$/gm,'').replace(/\s+/gm,' ').replace(/\/\*.*\*\//g,'').replace(/'/g,'"')); }} (function yahvt() { if(sites()) { var vf, autoplay = false; try { vf = findVideoFile(); } catch(e) { console.log('yahvt: ' + e); } if(vf) { vf = decodeURIComponent(vf).replace(/\?/g,'&').replace('&','?'); if(GetCookie('us_autoplay','')=='yes') { SetCookie('us_autoplay', '', -1); autoplay = true; } if(window.self != window.top && !autoplay) { document.body.innerHTML = '
Video '+((/(part|clip)_?\d/.test(vf+document.URL)) ? 'part ' : '')+'found at ' + domainName(document.URL) + '.
Video not found.
'; break; } } while(i); } } function insertVideo() { document.body.innerHTML = ''; var v = obj('VIDEO'), fs = GetCookie('us_fullscreen', '')=='yes', nvf = NextPart(document.URL), retry = 3; console.log('starting ' + domain + (nvf ? (' video part '+nvf[2]+': ') : ' video: ') + vf); if(fs) SetCookie('us_fullscreen', '', -1); v.oncanplay = function(e) { if(fs) SetFullScreenMode(); // v.parentNode.onclick=function(ev) { ev.preventDefault(); ev.stopPropagation(); }; }; v.onerror = function(e) { if((e.target.error.code == 4) && (--retry >= 0)) { //console.log('retry ' + retry); v.removeAttribute('src'); if(vf.match(/&html5(=true)?/)) vf = vf.replace(/&html5(=true)?/, '&noflash'); else if(vf.match(/&noflash(=true)?/)) vf = vf.replace(/&noflash(=true)?/, ''); else vf = vf + '&html5=true'; v.setAttribute('src', vf); v.setAttribute('autoplay', 'true'); return; } if((e.target.error.code==4) && nvf && (nvf[0]>2)) document.body.innerHTML = '