AdhityaRimba

HMA Key Crawler

Jan 24th, 2021 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. const fetch = require("node-fetch");
  2. var fs = require("fs");
  3.  
  4. var link = /\b(?:https|http):\/\/(?:.)+?\.(?:com|org|net)\b/g;
  5. var vid = /watch\?v\=[^ \n"]*/g;
  6. var hma = /\b\w{6}\-\w{6}\-\w{6}/g;
  7.  
  8. var result = "";
  9. var keylist = [];
  10. var linklist = [];
  11. var linklistvalid = [];
  12.  
  13. function crawl(){
  14. fetch("https://google-search3.p.rapidapi.com/api/v1/search/q=hma+vpn+key&num=100", {
  15. "method": "GET",
  16. "headers": {
  17. "x-rapidapi-key": "priv",
  18. "x-rapidapi-host": "google-search3.p.rapidapi.com"
  19. }
  20. })
  21. .then(res => res.json())
  22. .then(json => {
  23. console.log("Done");
  24. result += json.results;
  25. })
  26. .catch(e =>{
  27.  
  28. })
  29. }
  30.  
  31. async function main(){
  32. await fetch("https://google-search3.p.rapidapi.com/api/v1/search/q=V87R4M-QEEQB2-5S48WE&num=100", {
  33. "method": "GET",
  34. "headers": {
  35. "x-rapidapi-key": "priv",
  36. "x-rapidapi-host": "google-search3.p.rapidapi.com"
  37. }
  38. })
  39. .then(res => res.json())
  40. .then(json => {
  41. console.log("Done");
  42. result = json.results;
  43. })
  44. .catch(e => {
  45.  
  46. })
  47.  
  48. await result.forEach(subobject => {
  49. var link = subobject.link;
  50. var description = subobject.description;
  51. var desckey = description.match(hma);
  52. if(desckey != null) keylist.push(...desckey);
  53. console.log(link);
  54. linklist.push(link);
  55. //console.log("Done");
  56. });
  57.  
  58. for(var link in linklist){
  59. await console.log(linklist[link]);
  60. await fetch(linklist[link])
  61. .then(res => res.text())
  62. .then(body => {
  63. var key = body.match(hma);
  64. console.log(key);
  65. if(key != null) keylist.push(...key);
  66. })
  67. .catch(e => {
  68.  
  69. })
  70. }
  71.  
  72. for(var valid in keylist){
  73. if(keylist[valid].match(/[0-9]/g) != null) linklistvalid.push(keylist[valid]);
  74. }
  75.  
  76. linklistvalid.forEach(key => {
  77. console.log(key);
  78. fs.appendFileSync("keys.txt", "\n"+key);
  79. });
  80. }
  81.  
  82. main();
Add Comment
Please, Sign In to add comment