Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name mfc-cb
- // @namespace none
- // @include http://www.myfreecams.com/*
- // @include https://*chaturbate.com/*
- // @grant none
- // ==/UserScript==
- var savePath = "C:/webcams/";
- var fileType = "mp4"; // ts or mp4
- format = function date2str(x, y) {
- var z = {
- M: x.getMonth() + 1,
- d: x.getDate(),
- h: x.getHours(),
- m: x.getMinutes(),
- s: x.getSeconds()
- };
- y = y.replace(/(M+|d+|h+|m+|s+)/g, function(v) {
- return ((v.length > 1 ? "0" : "") + eval('z.' + v.slice(-1))).slice(-2)
- });
- return y.replace(/(y+)/g, function(v) {
- return x.getFullYear().toString().slice(-v.length)
- });
- }
- if (location.hostname === 'chaturbate.com') {
- var myVar = setInterval(function(){ cbTimer() }, 100);
- function cbTimer() {
- myPlayer = document.getElementById('xmovie');
- if (myPlayer != null){
- myFlashVars = myPlayer.getElementsByTagName('param')[6].value;
- modelName = myFlashVars.replace(/pid\=(\w+)&.+/,"$1");
- myDate = format(new Date(), 'yyyyMMddhhmm');
- streamUrl = document.getElementsByTagName('html')[0].innerHTML.match(/(http\:\/\/\w+\.stream\.highwebmedia\.com:1935\/live-origin\/[\w\-]+\/playlist\.m3u8)/i)[1];
- myRipCode = 'alert(\'ffmpeg -v error -i "'+streamUrl+'" -vcodec copy -acodec copy ';
- if (fileType=="mp4") myRipCode = myRipCode + '-bsf:a aac_adtstoasc ';
- myRipCode = myRipCode+savePath+modelName+'-'+myDate+'.'+fileType+'\')';
- var myButton = document.createElement ('div');
- myButton.innerHTML = '<input type="button" style="position:absolute;right:0px; top:0px;" id="ripButton" value="Rip" onClick="'+myRipCode+'" />';
- tokenOptions = document.getElementsByClassName('token_options')[0];
- tokenOptions.appendChild(myButton);
- myStopFunction();
- }
- }
- }
- if (location.hostname === 'www.myfreecams.com') {
- var myVar = setInterval(function(){ mfcTimer() }, 100);
- function mfcTimer() {
- popUp = document.getElementById('popup_content');
- if (popUp != null){
- if (popUp.innerHTML.indexOf('PopUserMenu')!=-1) {
- myImg = popUp.getElementsByTagName('img')[1].src;
- if (myImg.indexOf('mfcimg.com')==-1 && myImg.indexOf('www.myfreecams.com')==-1){
- var myRipButton = document.getElementById('ripButton');
- if (myRipButton == null){
- modelName = popUp.getElementsByTagName('a')[0].title.replace("View Profile of ","");
- myDate = format(new Date(), 'yyyyMMddhhmm');
- myRipCode = 'alert(\'ffmpeg -v error -i "http://'+myImg.replace(/http.+(video\d+).+/,"$1")+'.myfreecams.com:1935/NxServer/mfc_'+myImg.replace(/.+myfreecams\.com\/single\/100x80\/(\d+)\?no.+/,"$1")+'.f4v_aac/chunklist.m3u8" -vcodec copy -acodec copy ';
- if (fileType=="mp4") myRipCode = myRipCode + '-bsf:a aac_adtstoasc ';
- myRipCode = myRipCode+savePath+modelName+'-'+myDate+'.'+fileType+'\')';
- var myButton = document.createElement ('div');
- myButton.innerHTML = '<div style="display:block;clear:both;" id="ripButton"><input type="button" style="margin-left:195px;margin-top:125px;position:absolute;z-index:1" name="irrelevant" value="Rip" onClick="'+myRipCode+'" /></div>';
- popUp.getElementsByTagName('a')[0].parentNode.insertBefore(myButton, popUp.getElementsByTagName('a')[0]);
- }
- }
- }
- }
- }
- }
- function myStopFunction() {
- clearInterval(myVar);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement