Advertisement
Guest User

js

a guest
Nov 16th, 2015
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. // ==UserScript==
  2. // @name mfc-cb
  3. // @namespace none
  4. // @include http://www.myfreecams.com/*
  5. // @include https://*chaturbate.com/*
  6. // @grant none
  7. // ==/UserScript==
  8.  
  9. var savePath = "C:/webcams/";
  10. var fileType = "mp4"; // ts or mp4
  11.  
  12. format = function date2str(x, y) {
  13. var z = {
  14. M: x.getMonth() + 1,
  15. d: x.getDate(),
  16. h: x.getHours(),
  17. m: x.getMinutes(),
  18. s: x.getSeconds()
  19. };
  20. y = y.replace(/(M+|d+|h+|m+|s+)/g, function(v) {
  21. return ((v.length > 1 ? "0" : "") + eval('z.' + v.slice(-1))).slice(-2)
  22. });
  23.  
  24. return y.replace(/(y+)/g, function(v) {
  25. return x.getFullYear().toString().slice(-v.length)
  26. });
  27. }
  28.  
  29. if (location.hostname === 'chaturbate.com') {
  30. var myVar = setInterval(function(){ cbTimer() }, 100);
  31. function cbTimer() {
  32. myPlayer = document.getElementById('xmovie');
  33. if (myPlayer != null){
  34. myFlashVars = myPlayer.getElementsByTagName('param')[6].value;
  35. modelName = myFlashVars.replace(/pid\=(\w+)&.+/,"$1");
  36. myDate = format(new Date(), 'yyyyMMddhhmm');
  37. streamUrl = document.getElementsByTagName('html')[0].innerHTML.match(/(http\:\/\/\w+\.stream\.highwebmedia\.com:1935\/live-origin\/[\w\-]+\/playlist\.m3u8)/i)[1];
  38. myRipCode = 'alert(\'ffmpeg -v error -i "'+streamUrl+'" -vcodec copy -acodec copy ';
  39. if (fileType=="mp4") myRipCode = myRipCode + '-bsf:a aac_adtstoasc ';
  40. myRipCode = myRipCode+savePath+modelName+'-'+myDate+'.'+fileType+'\')';
  41. var myButton = document.createElement ('div');
  42. myButton.innerHTML = '<input type="button" style="position:absolute;right:0px; top:0px;" id="ripButton" value="Rip" onClick="'+myRipCode+'" />';
  43. tokenOptions = document.getElementsByClassName('token_options')[0];
  44. tokenOptions.appendChild(myButton);
  45. myStopFunction();
  46. }
  47. }
  48. }
  49.  
  50. if (location.hostname === 'www.myfreecams.com') {
  51. var myVar = setInterval(function(){ mfcTimer() }, 100);
  52. function mfcTimer() {
  53. popUp = document.getElementById('popup_content');
  54. if (popUp != null){
  55. if (popUp.innerHTML.indexOf('PopUserMenu')!=-1) {
  56. myImg = popUp.getElementsByTagName('img')[1].src;
  57. if (myImg.indexOf('mfcimg.com')==-1 && myImg.indexOf('www.myfreecams.com')==-1){
  58. var myRipButton = document.getElementById('ripButton');
  59. if (myRipButton == null){
  60. modelName = popUp.getElementsByTagName('a')[0].title.replace("View Profile of ","");
  61. myDate = format(new Date(), 'yyyyMMddhhmm');
  62. myRipCode = 'alert(\'ffmpeg -v error -i &quot;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&quot; -vcodec copy -acodec copy ';
  63. if (fileType=="mp4") myRipCode = myRipCode + '-bsf:a aac_adtstoasc ';
  64. myRipCode = myRipCode+savePath+modelName+'-'+myDate+'.'+fileType+'\')';
  65. var myButton = document.createElement ('div');
  66. 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>';
  67. popUp.getElementsByTagName('a')[0].parentNode.insertBefore(myButton, popUp.getElementsByTagName('a')[0]);
  68. }
  69. }
  70. }
  71. }
  72. }
  73. }
  74.  
  75. function myStopFunction() {
  76. clearInterval(myVar);
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement