Advertisement
Guest User

Trollvids Sauce Finder (v1.1)

a guest
Sep 5th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. javascript:function main(){if(window.location.hostname!="trollvids.com"){var e="This script will only work on trollvids.com";alert(e);throw new Error(e)}var t=$(".watch_left .player_container");if(!t.length){modal.open("Video player not found","Couldn't find the video player on this page. Maybe the site updated.");return}if(t.find("iframe").length){var n=t.find("iframe").attr("src").match(/file\/d\/(.*)\/preview/);n=n?n[1]:null;if(!n){modal.open("Video Not Found","Couldn't find the video source. Sorry!");return false}var r="https://docs.google.com/uc?id="+n+"&export=download";var i="";i+="<a class='btn' href='"+t.find("iframe").attr("src")+"?start=1"+"' target='_blank'><i class='fa fa-play'></i> Watch Google Video</a>";i+="<a class='btn' href='"+r+"' target='_blank'><i class='fa fa-download'></i> Download Google Video</a>";modal.open("Video Found",i)}else if(t.find("#nuevoplayer_top").length){var n=document.URL.match(/video\/(.*)\//);n=n?n[1]:null;var s="/nuevo/player/config.php";$.ajax({url:s,data:{v:n},success:function(e){e=$(e);var t=e.find("config file").text();var r="Video Found";var i="";if(t){if(t.indexOf(".flv")>-1){i+="<a class='btn' href='"+t+"' target='_blank'><i class='fa fa-download'></i> Download (SD FLV)</a>"}else if(t.indexOf(".mp4")>-1){i+="<a class='btn' href='"+t+"' target='_blank'><i class='fa fa-download'></i> Download (SD MP4)</a>"}else if(t.indexOf("youtube")>-1){i+="<a class='btn' href='"+t+"' target='_blank'><i class='fa fa-play'></i> Watch YouTube Video</a>"}else{i+="<a class='btn' href='"+t+"' target='_blank'><i class='fa fa-download'></i> Download (SD)</a>"}}var o=e.find("config filehd").text();if(o){i+="<a class='btn' href='"+o+"' target='_blank'><i class='fa fa-download'></i> Download (HD MP4)</a>"}if(i==""){r="Video Not Found";i+="<p>Couldn't find the video source. Sorry!</p>"}i+="<br><br><a href='"+s+"?v="+n+"' target='_blank'>View video config data</a>";i+="<i class='muted'>Note: Some video sources may be missing due to site issues.</i>";modal.open(r,i)}})}else{modal.open("Video Not Found","This embedded video format hasn't been coded into this script!")}}function init(){modal.init=true;modal.close=function(){if(modal.object){modal.object.fadeOut(200,function(){$(this).remove()});modal.object=null}};$('<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">').appendTo("body");$("<style>#tsf{line-height: 20px;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:block;background-color:rgba(0,0,0,.5)}#tsf .dialogue{background-color:#292929;color:#eee;max-width:600px;height:200px;margin:0 auto;font-size:14px;position:relative;box-shadow:0 2px 6px rgba(0,0,0,.7)}#tsf .muted{color:#777;font-size:13px}#tsf a{color:#aaa;display:block}#tsf a:hover{color:#ccc}#tsf .close{position:absolute;top:0;right:0;margin:6px 8px;font-size:20px;cursor:pointer;color:#aaa}#tsf .close:hover{color:#ccc}#tsf .header{border-bottom:1px solid #444;font-size:20px;padding:8px}#tsf .content{padding:8px}#tsf a.btn{background-color:#333;border:1px solid #444;border-radius:2px;padding:7px 9px;display:inline-block;margin:3px;text-decoration:none}#tsf a.btn:hover{background-color:#393939;}#tsf *{transition:color .2s,background-color .2s;} #tsf .version{position:absolute;bottom:0;right:0;text-align:right;font-size:11px;color:#777;padding:3px 5px;}</style>").appendTo("body");modal.open=function(e,t){modal.close();var n="<div id='tsf'><div class='dialogue'><div class='close'><i class='fa fa-times'></i></div><div class='header'></div><div class='content'></div><div class='version'></div></div></div>";modal.object=$(n);modal.object.find(".close").click(modal.close);modal.object.find(".header").html(e);modal.object.find(".content").html(t);modal.object.find(".version").html(modal.info);$("body").append(modal.object);modal.object.hide();modal.object.fadeIn(200);modal.object.find(".dialogue").animate({"margin-top":"30px"},200)};$(document).mouseup(function(e){if($(e.target).is("#tsf"))modal.close()})}if(typeof $==="undefined"){var error="Could not find jQuery object!";alert(error);throw new Error(error)}if(typeof modal==="undefined"){var modal={};modal.init=false;modal.info="Trollvids Sauce Finder v1.1"}if(!modal.init)init();main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement