westor

/download_proxies for Debian

May 31st, 2022 (edited)
715
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.32 KB | None | 0 0
  1. alias download_proxies {
  2.   ; /download_proxies <URL>
  3.  
  4.   if (!$1) { return }
  5.  
  6.   if ($1 isnum) {
  7.     if ($urlget($1).state == fail) { echo 4 -at /download_proxies: Error, Connection failed! | return }
  8.  
  9.     copy_proxies $urlget($1).target
  10.   }
  11.  
  12.   if ($1 isurl) {
  13.     var %file = source.txt
  14.  
  15.     write -c $qt(%file)
  16.  
  17.     echo -tac info * /download_proxies: Retrieving ips + ports from $1-
  18.  
  19.     return $urlget($1,gfi,%file,download_proxies)
  20.   }
  21.  
  22. }
  23.  
  24. alias copy_proxies {
  25.   ; /copy_clipboard <path\file>
  26.  
  27.   if (!$1-) || (!$file($1-)) { return }
  28.  
  29.   var %f = $1-
  30.  
  31.   var %f1 = proxies.txt
  32.   var %f2 = ports.txt
  33.  
  34.   var %tot_ips = 0
  35.   var %tot_ports = 0
  36.   var %tot = 0
  37.  
  38.   var %t = $lines(%f)
  39.   var %i = 1
  40.  
  41.   while (%i <= %t) {
  42.     var %line = $read(%f,n,%i)
  43.     var %ip = $gettok($gettok(%line,1,32),1,58)
  44.     var %port = $gettok($gettok(%line,1,32),2,58)
  45.  
  46.     if (%line) && (%ip) && (%port) && ($iptype(%ip)) && ($isnumber(%port)) {
  47.       inc %tot 1
  48.  
  49.       var %r1 = $read(%f1,nw,$+(%ip,:,%port))
  50.       var %r2 = $read(%f2,nw,%port)
  51.  
  52.       if (!%r1) { inc %tot_ips 1 | write $qt(%f1) $+(%ip,:,%port) }
  53.       if (!%r2) { inc %tot_ports 1 | write $qt(%f2) %port }
  54.     }
  55.  
  56.     inc %i
  57.   }
  58.  
  59.   echo -tac info * /download_proxies: Finished! %tot_ips ips and %tot_ports ports copied from %tot items!
  60. }
  61.  
  62.  
Add Comment
Please, Sign In to add comment