Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name FB-Séries
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Transforma algo bom, em melhor.
- // @icon http://www.brseries.com/wp-content/uploads/2017/08/favicon.png
- // @author Alan
- // @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
- // @require http://vjs.zencdn.net/6.6.0/video.js
- // @match *://www.fbseries.com/*
- // @connect *
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var code = "function toggleIframe (option) {switch (option) {case true:$('.iframe-video').show();$('div#fbMsg').hide();$('body').attr('style', 'overflow: hidden!important;');break;case false:$('.iframe-video').hide();$('div#fbMsg').show();$('body').attr('style', 'overflow: visible!important;');break;default:if (toggleI==true) {toggleI=false;}else {toggleI=true;}if (toggleI==true) {$('.iframe-video').show();$('div#fbMsg').hide();$('body').attr('style', 'overflow: hidden!important;');}else {$('.iframe-video').hide();$('div#fbMsg').show();$('body').attr('style', 'overflow: visible!important;');}}}$('.iframe-btn').click(function(){var myPlayer = videojs('my_video_1');myPlayer.pause(1);document.webkitExitFullscreen();toggleIframe(false);});";
- var codeHTML = '<div class="iframe-video"><div class="video-info"><video id="my_video_1" class="video-js vjs-default-skin" width="640px" height="267px" controls preload="none" poster="" data-setup="{}"><source src="https://vjs.zencdn.net/v/oceans.mp4" type="video/mp4" /><source src="https://vjs.zencdn.net/v/oceans.webm" type="video/webm" /></video><script src="http://vjs.zencdn.net/6.6.0/video.js"></script></div></div>';
- var codeCSS = '.iframe-video {background-color: black;width: 100vw;height: 100vh;z-index: 1000;top: 0;position: fixed;display: flex;flex-direction: row;align-items: center;justify-content: center;}.video-info {width: calc(100vw - 2em);height: calc(100vh - 2em);background-color: red;}.video-js .vjs-big-play-button {position: relative!important;margin-top: -47%;}div#my_video_1 {display: flex;align-items: center;justify-content: center;flex-direction: row;width: 100%;height: 100%;}.iframe-epName {top: 10px;position: absolute;left: 8em;margin-top: 1.65em;}p.nameC {color: white;font-size: 21px;}.iframe-epName span {font-size: 18px;}span.tempC {color: #ffffff8a;}span.epC {color: #ffffff8a;margin-left: 9px;}.iframe-btn {width: 50px;height: 50px;position: absolute;top: 0;margin: 13px;border-radius: 50%;display: flex;flex-direction: row;align-items: center;justify-content: center;cursor: pointer;transition: 1s ease;left: 0;}.iframe-btn:hover {background-color: #ffffff17;}i.iframe-btn-icon {font-size: 25px;margin-bottom: 2px;color: #ffffff87;transition: 1s ease;}.iframe-btn:hover>i.iframe-btn-icon {color: #ffffffc2;}.continue-box {background-color: black;width: 160px;height: fit-content;display: flex;align-items: center;justify-content: center;border: 1px solid dimgrey;margin-left: auto;margin-right: auto;cursor: pointer;flex-direction: column;}p.continue-btn {margin: 0;color: white;font-weight: bolder;font-size: 14px;font-family: "Open Sans",Arial,sans-serif;}.continue-box span {font-size: 98%;}span.continue-temp {margin-bottom: -5px;}';
- var codeCDN = '<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"><link href="http://vjs.zencdn.net/6.6.0/video-js.css" rel="stylesheet"><script src="http://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>';
- var codeHTML2 = '<div class="iframe-btn"><i class="fa fa-arrow-left iframe-btn-icon" aria-hidden="true"></i></div><div class="iframe-epName"><p class="nameC">NOMEhfgjshgds<br></p><span class="tempC">T:1</span><span class="epC">EP:1</span></div>';
- var codeHTML3 = '<div class="continue-box"><p class="continue-btn">Continuar</p><span class="continue-temp"></span><span class="continue-ep"></span></div>';
- var tudo, nome, url, tabsQ, epsQ, i, listaQ;
- var pUrl = $('span.last-bread').text();
- var toggleI = false;
- var serieString = "";
- var realLink = "";
- var dC = 1;
- var lC = 1;
- var cEpR,cLink,cEp,cTemp,cName,cLang,cTempo;
- var res, arr1,arr,arr2,convert1;
- var epL = "";
- var objF = {};
- var fim = false;
- var count = 0;
- var epN = "";
- var epNC = "";
- var mark3 = 0;
- var mark4 = 1;
- var intervalo2;
- var mark2 = 1;
- var r = 0;
- var mark1 = 0;
- var pode = true;
- var teste = $(".tab_container .tab_content:nth-of-type(1) .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type(1)").text();
- var teste1 = $(".tab_container .tab_content:nth-of-type(1) .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type(1) a").text();
- var imagemS = $(".capa-single img").attr('src');
- var Brs = {
- series : {},
- formJSON : function (setB) {
- //Set vars
- mark1 = 1;
- mark3 = 0;
- mark4 = 0;
- mark2 = 1;
- pode = true;
- pUrl = $('span.last-bread').text();
- url = window.location.href;
- tabsQ = $("ul.tabs li").length;
- epsQ = $(".check_lista ul li").length;
- listaQ = $(".tab_container .tab_content").length;
- //Set series values
- Brs.series[pUrl] = [];
- Brs.series[pUrl].eps = [];
- Brs.series[pUrl].pageUrl = url;
- Brs.series[pUrl].eps[mark1] = [];
- Brs.series[pUrl].eps[mark1].dublado = [];
- Brs.series[pUrl].eps[mark1].legendado = [];
- //loop for eps
- while (fim == false) {
- switch (mark2) {
- case 1:
- if (dC==1) {
- Brs.series[pUrl].eps[mark1] = [];
- Brs.series[pUrl].eps[mark1].dublado = [];
- }
- mark3 = $(".tab_container .tab_content:nth-child("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li").length;
- epL = $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a").attr('href');
- epN = $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a").text();
- epNC = $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a").attr('title');
- realLink = epL.replace("http://www.fbseries.com/video/home.php?v=","https://www.blogger.com/video-play.mp4?contentId=");
- if (setB==true) {
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a[href^='http://www.fbseries.com/video/home.php?v=']").attr('temp', mark1);
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a[href^='http://www.fbseries.com/video/home.php?v=']").attr('ep', epN);
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a[href^='http://www.fbseries.com/video/home.php?v=']").attr('lang', "dublado");
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a[href^='http://www.fbseries.com/video/home.php?v=']").attr('rlink', realLink);
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(1) .check_lista ul li:nth-of-type("+dC+") a[href^='http://www.fbseries.com/video/home.php?v=']").removeAttr("href");
- }
- Brs.series[pUrl].eps[mark1].dublado[epN] = [];
- Brs.series[pUrl].eps[mark1].dublado[epN] = {link: epL,nome: epNC,mLink: realLink};
- dC++;
- if (dC > mark3) {dC=1;mark2= 2;}
- break;
- case 2:
- if (lC==1) {
- Brs.series[pUrl].eps[mark1].legendado = [];
- }
- mark3 = $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li").length;
- epL = $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a").attr('href');
- epN = $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a").text();
- epNC = $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a").attr('title');
- realLink = epL.replace("http://www.fbseries.com/video/home.php?v=","https://www.blogger.com/video-play.mp4?contentId=");
- if (setB==true) {
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a[href^='http://www.fbseries.com/video/home.php?v=']").attr('rlink', realLink);
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a[href^='http://www.fbseries.com/video/home.php?v=']").removeAttr("href");
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a").attr("temp", mark1);
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a").attr("ep", epN);
- $(".tab_container .tab_content:nth-of-type("+mark1+") .um_terco:nth-of-type(2) .check_lista ul li:nth-of-type("+lC+") a").attr("lang", "legendado");
- }
- Brs.series[pUrl].eps[mark1].legendado[epN] = [];
- Brs.series[pUrl].eps[mark1].legendado[epN]= {link: epL,nome: epNC,mLink: realLink};
- lC++;
- if (lC > mark3) {lC=1;mark1++;mark2= 1;}
- break;
- }
- count++;
- mark4++;
- if (mark1 > tabsQ) {fim=true;}
- if (count > epsQ) {fim=true;}
- }
- //console.log(Brs.series);
- fim=false;
- },
- formCookie : function (el,tempF,epF,langF,urlF,PurlF,titleF) {
- switch(el) {
- case 1:
- objF.temp = tempF;
- objF.ep = epF;
- objF.lang = langF;
- objF.url = urlF;
- objF.Purl = PurlF;
- objF.title = titleF;
- var objString = '{"temp":'+objF.temp+',"ep":'+'"'+objF.ep+'"'+',"lang":'+'"'+objF.lang+'"'+',"url":'+'"'+objF.url+'"'+',"Purl":'+'"'+objF.Purl+'"'+',"title":'+'"'+objF.title+'"'+'}';
- Brs.setCookie(pUrl,objString,1);
- break;
- case 2:
- var objG = Brs.getCookie(pUrl);
- if (objG == null || objG == ""){console.log("Erro");}else {
- $(".continue-box").show();
- var objP = JSON.parse(objG);
- var Vtemp = objP.temp;
- var Vep = objP.ep;
- var Vurl = objP.url;
- var Vtitle = objP.title;
- var Vlang = objP.lang;
- var Vtempo = parseInt(objP.tempo);
- $("div.continue-box").attr("jj","de");
- $("div.continue-box").attr("temp",Vtemp);
- $("div.continue-box").attr("ep",Vep);
- $("div.continue-box").attr("rlink",Vurl);
- $("div.continue-box").attr("title",Vtitle);
- $("div.continue-box").attr("lang",Vlang);
- $("div.continue-box").attr("tempo",Vtempo);
- $(".continue-temp").text("Temporada "+Vtemp);
- $(".continue-ep").text(Vep+"("+Vlang+")");
- console.log("objP: "+JSON.stringify(objP));
- console.log(Vtempo);
- }
- break;
- case 3:
- var Tagora = $('.vjs-time-tooltip').text();
- console.log(Tagora);
- if (Tagora.length>5){
- arr = Tagora.split(":");
- res = arr[1].slice(2,4);
- arr1 = parseInt(res);
- arr2 = parseInt(arr[2]);
- convert1 = arr1*60+arr2;
- console.log("V: 1");
- }else{
- arr = Tagora.split(":");
- arr1 = parseInt(arr[0]);
- arr2 = parseInt(arr[1]);
- convert1 = arr1*60+arr2;
- console.log("V: 2");
- }
- objF = {};
- objF.temp = tempF;
- objF.ep = epF;
- objF.lang = langF;
- objF.url = urlF;
- objF.Purl = PurlF;
- objF.title = titleF;
- objF.tempo = convert1;
- console.log(objF.tempo);
- objString = '{"temp":'+objF.temp+',"ep":'+'"'+objF.ep+'"'+',"lang":'+'"'+objF.lang+'"'+',"url":'+'"'+objF.url+'"'+',"tempo":'+'"'+convert1+'"'+',"Purl":'+'"'+objF.Purl+'"'+',"title":'+'"'+objF.title+'"'+'}';
- Brs.setCookie(pUrl,objString,1);
- break;
- }
- },
- setCookie : function (cname,cvalue,exdays) {
- var d = new Date();
- d.setTime(d.getTime() + (exdays*1000*60*60*24*365));
- var expires = "expires=" + d.toGMTString();
- document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
- },
- getCookie : function (cname) {
- var name = cname + "=";
- var decodedCookie = decodeURIComponent(document.cookie);
- var ca = decodedCookie.split(';');
- for(var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') {
- c = c.substring(1);
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return "";
- },
- formIframe : function () {
- $("head").prepend(codeCDN);
- $("head").prepend('<script>'+code+'</script>');
- $("head").prepend('<style>'+codeCSS+'</style>');
- $(".content.content-single").prepend(codeHTML3);
- $("body").prepend(codeHTML);
- $(".iframe-video").hide();
- setTimeout(function(){
- $("div#my_video_1").append(codeHTML2);
- $(".iframe-btn").click(function(){
- var myPlayer = videojs('my_video_1');
- myPlayer.pause();
- document.webkitExitFullscreen();
- Brs.toggleIframe(false);
- });
- }, 5000);
- },
- debugConsole : function () {
- console.log(Brs.series);
- console.log("mark1: "+epsQ);
- console.log("mark1: "+mark1);
- console.log("mark3: "+mark3);
- console.log("mark4: "+mark4);
- console.log("mark2: "+mark2);
- console.log("lC: "+lC);
- console.log("dC: "+dC);
- console.log("teste: "+teste);
- console.log("teste1: "+teste1);
- console.log("cookie: "+Brs.getCookie(pUrl));
- },
- checkUrl : function () {},
- cancelFullScreen : function (el) {
- var requestMethod = el.cancelFullScreen||el.webkitCancelFullScreen||el.mozCancelFullScreen||el.exitFullscreen;
- if (requestMethod) { // cancel full screen.
- requestMethod.call(el);
- } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
- var wscript = new ActiveXObject("WScript.Shell");
- if (wscript !== null) {
- wscript.SendKeys("{F11}");
- }
- }
- },
- requestFullScreen : function (el) {
- // Supports most browsers and their versions.
- var requestMethod = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;
- if (requestMethod) { // Native full screen.
- requestMethod.call(el);
- } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
- var wscript = new ActiveXObject("WScript.Shell");
- if (wscript !== null) {
- wscript.SendKeys("{F11}");
- }
- }
- return false;
- },
- toggleFull : function () {
- var elem = document.body; // Make the body go full screen.
- var isInFullScreen = (document.fullScreenElement && document.fullScreenElement !== null) || (document.mozFullScreen || document.webkitIsFullScreen);
- if (isInFullScreen) {
- Brs.cancelFullScreen(document);
- } else {
- Brs.requestFullScreen(elem);
- }
- return false;
- },
- detectActive : function () {
- var cAtivo = $(".vjs-default-skin").hasClass("vjs-user-active");
- switch (cAtivo) {
- case true:
- $(".iframe-btn").fadeIn();
- $(".iframe-btn-icon").fadeIn();
- $(".iframe-epName").fadeIn();
- break;
- case false:
- $(".iframe-btn").fadeOut();
- $(".iframe-btn-icon").fadeOut();
- $(".iframe-epName").fadeOut();
- break;
- }
- },
- setVideo : function (el,Vurl,poster,play,name,temp,ep,tempo) {
- var myPlayer = videojs('my_video_1');
- var rTempo = parseInt(tempo);
- console.log(rTempo);
- switch(el) {
- case 1:
- myPlayer.poster(poster);
- myPlayer.src(Vurl);
- $("p.nameC").text(name);
- $("span.tempC").text("Temp: "+temp);
- $("span.epC").text(" "+ep);
- myPlayer.currentTime(rTempo);
- myPlayer.play(play);
- // setTimeout(function(){
- // console.log(myPlayer.currentTime());
- // }, 5000);
- break;
- case 2:
- break;
- }
- },
- toggleIframe : function (option) {
- switch (option) {
- case true:
- $(".iframe-video").show();
- $(".iframe-video").attr('style', 'visibility: visible!important;');
- $(".video-info").show();
- $("div#my_video_1").show();
- $("div#fbMsg").hide();
- $("body").attr('style', 'overflow: hidden!important;');
- break;
- case false:
- clearInterval(intervalo2);
- Brs.formCookie(2);
- $(".iframe-video").hide();
- $(".iframe-video").attr('style', 'visibility: hidden!important;');
- $(".video-info").hide();
- $("div#my_video_1").hide();
- $("div#fbMsg").show();
- $("body").attr('style', 'overflow: visible!important;');
- break;
- default:
- if (toggleI==true) {toggleI=false;}else {toggleI=true;}
- if (toggleI==true) {
- $(".iframe-video").show();
- $(".video-info").show();
- $("div#fbMsg").hide();
- $("body").attr('style', 'overflow: hidden!important;');
- }else {
- $(".iframe-video").hide();
- $(".video-info").hide();
- $("div#fbMsg").show();
- $("body").attr('style', 'overflow: visible!important;');
- }
- }
- }
- };
- if (teste=="NÃO DISPONÍVEL" || teste1=="Para assistir todos os episódios CLIQUE aqui!") {
- console.log("Erro: Não Disponivel");
- }else {
- Brs.formIframe();
- Brs.formJSON(true);
- Brs.toggleIframe(false);
- //serieString = JSON.stringify(Brs.series[pUrl]);
- //Brs.setCookie(pUrl, serieString, 1);
- Brs.debugConsole();
- }
- $(".iframe-btn").click(function(){
- var myPlayer = videojs('my_video_1');
- myPlayer.pause(1);
- //Brs.formCookie(3,cTemp,cEpR,cLang,cLink,url,cName);
- Brs.formCookie(2);
- document.webkitExitFullscreen();
- Brs.toggleIframe(false);
- clearInterval(intervalo2);
- });
- $(".check_lista ul li a[rlink^='https://www.blogger.com']").click(function(){
- cEpR = $(this).text();
- cLink = $(this).attr("rlink");
- cEp = $(this).attr("ep");
- cTemp = $(this).attr("temp");
- cName = $(this).attr("title");
- cLang = $(this).attr("lang");
- cTempo = $(this).attr("tempo");
- Brs.setVideo(1,cLink,imagemS,1,cName,cTemp,cEp,cTempo);
- // Brs.formCookie(3,cTemp,cEpR,cLang,cLink,url,cName);
- // Brs.formCookie(2);
- intervalo2 = setInterval(function(){ Brs.formCookie(3,cTemp,cEpR,cLang,cLink,url,cName);Brs.formCookie(2); }, 1000);
- Brs.toggleIframe(true);
- });
- var intervalo = setInterval(Brs.detectActive, 100);
- $(".continue-box").click(function(){
- var Clink = $(".continue-box").attr("rlink");
- var Cep = $(".continue-box").attr("ep");
- var Ctemp = $(".continue-box").attr("temp");
- var Ctempo = $(".continue-box").attr("tempo");
- var Cname = $(".continue-box").attr("title");
- var Clang = $(".continue-box").attr("lang");
- Brs.setVideo(1,Clink,imagemS,1,Cname,Ctemp,Cep,Ctempo);
- Brs.toggleIframe(true);
- });
- $(".continue-box").hide();
- Brs.formCookie(2);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement