您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove ads, enlarge video, add video download links, block popups and stops autoplay keeping buffering
当前为
// ==UserScript== // @author Jack_mustang // @version 4.11.1 // @name ExtendRedTube // @description Remove ads, enlarge video, add video download links, block popups and stops autoplay keeping buffering // @date 2015 January 28 // @include *redtube.com* // @include *redtube.org* // @include *redtube.cz* // @include *redtube.es* // @include *redtube.fr* // @include *redtube.it* // @include *redtube.kr* // @include *redtube.pl* // @include *redtube.si* // @exclude *blog.redtube.com* // @run-at document-start // @grant none // @license Public Domain // @namespace 44db8537bb6ac3d112dd3b5ec7b6b33b84aa5765 // @icon http://public.bay.livefilestore.com/y1pSshvmSZkkqp0NsmeCM6Sk8SQOC3rcOl29uZRUd_YsrSd4aMGNBmYYChRlRnZu9ht5pDhWoVglIGo11ITBXNW4Q/ExtendRedTubeIcon.png // ==/UserScript== var ExtendRT = function ExtendRedTube() { // Pop-up killer, we trick RT to think we are old Presto Opera, this kills the pop-ups if (!window.opera) window.opera = true //Inject blocker and CSS addStuff() window.addEventListener('DOMContentLoaded', function() { // Remove ads functions, comment these if you just want them hidden function removeQuery(query) { var ifr = document.querySelectorAll(query) if(ifr.length > 0) for(var i=0; i < ifr.length; i++) ifr[i].parentNode.removeChild(ifr[i]) } // Remove header ad removeQuery('#as_134') // Remove footer ad removeQuery('#as_131') // Remove right ad removeQuery('.sb') removeQuery('div.qb') // Remove iframe ads removeQuery("iframe") if(document.getElementById('redtube_flv_player')) { // Scroll video to middle of page function scrollthere() { var vid = document.querySelector('.watch'), vh = vid.offsetHeight, vd = vid.offsetTop + document.querySelector('.pageVideos').offsetTop, fh = window.innerHeight, sc = vd-((fh-vh)/2) scrollTo(0, sc) }// Now inject this function var script = document.createElement("script") script.setAttribute("type","text/javascript") script.innerHTML = scrollthere.toString() + "scrollthere();" script.id = ("ERT-scrollVid") document.body.appendChild(script) // Include button in right corner to center video on screen; var node = document.createElement("div") node.setAttribute("style", "position:fixed; bottom:0; right:0; top:auto!important; height:15px; width:80px; cursor:pointer; background:#121212; padding:5px 10px; border:1px solid #202020 ") node.setAttribute("onclick", "scrollthere();") node.innerHTML = "Center video" document.body.appendChild(node) // Change player var player = document.querySelector('#redtube_flv_player').parentNode.innerHTML player = player.replace(/autoplay=true/g,"autoplay=false&autoload=true") player = player.replace(/disablePauseroll=false/g,"disablePauseroll=true") player = player.replace(/disable_sharebar=false/g,"disable_sharebar=true") player = player.replace(/&pauseroll_url=http:\/\/ads(.*).php/g,"") document.querySelector('#redtube_flv_player').parentNode.innerHTML = player // Add FLV text var flvLink = document.getElementById("download-link-flv") flvLink.innerHTML = "FLV " + flvLink.innerHTML // Include thumbnail button tab var thumbtab = document.createElement("li") thumbtab.innerHTML = "<a style='cursor:pointer' onclick='$(\"div[class*=tab-content]\").css({\"display\": \"none\"});$(\"#tabsParent>ul li\").attr(\"class\",\"\");$(\"#tabsParent>ul li:last-child\").attr(\"class\",\"activeTab\");$(\"#tabsContentHolder\").attr(\"style\",\"display:none\");$(\"#tagger_thumbs\").attr(\"style\",\"\");$(\"#tabsContentHolder\").slideDown(\"slow\");'>Thumbnails</a>" var tabs = document.querySelector(".tabsElements") tabs.appendChild(thumbtab) // Add, check thumbs exist, change location if needed and include div function changeServer(num) { var s = '0', table = '', source, nums = num + 1, vidId = location.pathname vidId = vidId.slice(1) vidId2 = vidId.slice(0, vidId.length -3) while(vidId.length < 7) vidId = '0' + vidId while(vidId2.length < 7) vidId2 = '0' + vidId2 switch(num) { case 0: source = 'img03' break case 1: source = 'thumbs.lsw' break case 2: source = 'img01' break case 3: source = 'img02' break case 4: source = 'img04' break } for(i=1; i<17; i++) { if(i == 10) s = '' table = table + '<td><img class="te" ' if(i == 1 && num < 4) table = table + 'onerror="changeServer('+ nums +');"' table = table + 'src="http://'+ source +'.redtubefiles.com/_thumbs/'+ vidId2 +'/'+ vidId +'/'+ vidId +'_0'+ s + i +'m.jpg" /></td>' if(i == 4 || i == 8 || i == 12) table = table + '</tr><tr>' } if(num == 0) { var node = document.createElement('div') node.setAttribute('id', 'tagger_thumbs') node.setAttribute('style', 'overflow:hidden;display:none') } else var node = document.getElementById('tagger_thumbs') node.innerHTML = '<table style="padding:30px 20px 20px"><tr>'+ table +'</tr></table>' if(num == 0) document.getElementById('tabsContentHolder').appendChild(node) }// Now inject this function var thumbscript = document.createElement("script") thumbscript.setAttribute("type", "text/javascript") thumbscript.innerHTML = changeServer.toString() + "changeServer(0);" document.body.appendChild(thumbscript) // Download videos without loggin-in, we need to wait both jQuery and $rt.bootstrap.queue to populate var downloadNow = document.createElement("script") downloadNow.setAttribute("type", "text/javascript") downloadNow.setAttribute("id", "ERT-CAPETA") downloadNow.innerHTML = "function downVids() {\n\ var dwVid = $rt.bootstrap.queue\n\ for (var i=0; i<dwVid.length; i++)\n\ if (dwVid[i].func == 'initVideoDownload')\n\ for (var j=dwVid[i].params.length-1; j>=0; j--)\n\ if (typeof(dwVid[i].params[j]) === 'object')\n\ var downLinks = dwVid[i].params[j]\n\ link = [downLinks.hd,\n\ downLinks.flv,\n\ downLinks.mobile],\n\ linkElem = [document.getElementById('download-link-hd'),\n\ document.getElementById('download-link-flv'),\n\ document.getElementById('download-link-mobile')]\n\ for (i=0;i<3;i++)\n\ if (linkElem[i].href == 'javascript:;')\n\ linkElem[i].href = link[i]\n\ }\n\ function redoitalltime() {\n\ (window.jQuery && $rt.bootstrap.queue) ? downVids() : setTimeout(redoitalltime, 200)\n\ }redoitalltime()" document.body.appendChild(downloadNow) } },false) function addStuff() { // While <head> is not loaded we keep trying if (!document.querySelector("head")) return setTimeout(addStuff, 50) var targ = document.head // We create an object and start including its content to include in DOM at the end. var ertcss = // Hide ads while we can't remove them "#as_130, #as_131, #as_134, .sb, iframe {\n\ display: none !important\n\ }\n\ .qb {\n\ height: 0 !important\n\ overflow: hidden !important\n\ width: 0 !important\n\ }\n" + // Prevent background ad "body {\n\ background-color: #000 !important\n\ }\n" + // Make thumbs have 4 in every row "ul.video-listing.two-in-row {\n\ width: 100% !important;\n\ }\n\ ul.video-listing.two-in-row .first-in-row:nth-child(3) {\n\ clear: none;\n\ margin-left: 25px;\n\ }\n\ .videoThumbs.three-in-row + .videoThumbs.five-in-row {\n\ display: inline-block;\n\ margin-top: -228px\n\ }\n\ .videoThumbs.three-in-row + .videoThumbs.five-in-row li:first-of-type{\n\ margin-left: 190px !important\n\ }\n\ .videoThumbs > li {\n\ clear: none !important;\n\ margin: 0 9px 20px 0 !important\n\ }\n\ ul.videoThumbs {\n\ width: auto !important\n\ }\n" + /* PornStars page */ "ul.pornStarsThumbs.four-in-row, .pornstar-videos .video-listing.one-in-row {\n\ width: 100% !important\n\ }\n\ .pornStarsThumbs.four-in-row > li {\n\ clear: none !important;\n\ margin: 0 8px 20px 0 !important\n\ }\n\ .pornStarsThumbs.four-in-row > li:last-child {\n\ margin-right: 0 !important;\n\ }\n\ .pornstar-videos .video-listing.one-in-row li.first-in-row {\n\ clear: none !important;\n\ margin-right: 25px !important\n\ }\n" + /* Video Page */ // Enlarge player ".video-wrap, .watch, .videoPlayer, #redtubeplayer {\n\ width: 100% !important\n\ }\n\ .videoPlayer, #redtube_flv_player, #redtubeplayer {\n\ height: 547.3px !important;\n\ }\n\ .video-wrap h1.videoTitle {\n\ width: 800px !important\n\ }\n\ #html5_vid video {\n\ margin: 0 !important;\n\ height: 468px !important;\n\ width: 956px !important\n\ }\n" + /* Image galleries list */ ".albumThumbs.three-in-row {\n\ width: 100% !important\n\ }\n\ .albumThumbs.three-in-row li:nth-of-type(4) {\n\ clear: none !important;\n\ margin-left: 31px !important\n\ }\n" + /* Other random pages */ // API "#wrapper {\n\ background: #FFF !important\n\ }\n" // Inject created CSS var ertnode = document.createElement("style") ertnode.type = "text/css" ertnode.id = "ERT-style" ertnode.appendChild(document.createTextNode(ertcss)) targ.appendChild(ertnode) } }();