La Cofradía Digital

Hermandad informática


Alternativa ‘RapidBot’ -> AutoRapid

0
(0)

Antes que nada felicidades por el retorno y el nuevo look, aqui su humilde servidor les trae una version de ‘rapidbot’ version libre programada en Ruby (Cabe mencionar que estoy iniciando mis pininos)  lo he llamado autorapid.rb, tiene las siguientes caracteristicas:

-Descarga varios links de rapidshare – Uno por uno –

-Espera los tiempos necesarios para iniciar y terminar la descargas.

-Verifica que los links existan antes de proceder a la descarga.

-100% software libre.

-Puedes modificarlo y por supuesto mejorarlo,

Futuras Actualizaciones:

-Soporte de proxy.

-Descarga simultanea usando servidores proxys anonimos (Dificil pero creo que se puede lograr).

-Entorno grafico.

-Entre otras.

Espero les funcione y claro puedan colaborar en el proyecto, y ya encarrerados les menciono en este post sobre la creacion de un sitio web llamado http://www.vive-libre.org, el cual es entre muchos otros sitio de difusion y colaboracion de proyectos de software libre.

Espero lo visiten y obviamente descargen autorapid.rb.

Espero cualquier comentario y ayuda.

Gracias.

Pd. Al inicio de la pagina tarda un poco, ya saben cuestion de servidor.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.



6 responses to “Alternativa ‘RapidBot’ -> AutoRapid”

  1. Gracias por la aportación!!!
    Bastante bueno, es un gusto ver esas participaciones por aquí, estoy trabajando en algunas de las mejoras que propones, nada más que no he tenido mucho tiempo libre :S

  2. Te invito a que coloques tu código aquí para que pueda ser visto con mayor facilidad y rapidez.

  3. #Listo ahi esta el codigo espero te sirva, y lo mejores, saludos :D
    
    #!/usr/bin/env ruby
    #Author: Rivero Mercado Juan jrivero@vive-libre.org
    
    require 'net/http'
    require 'uri'
    
    begin
    	require 'Win32/Console/ANSI' if PLATFORM =~ /win32/
    rescue LoadError
    	raise "\n\nYou must intall win32console to use color on Microsoft Windows\ne.g. C:\>gem install win32console\n\n"
    end
    
    _Error=false
    _Continue=nil
    _Links=[]
    
    def Usage()
    	puts "Usage: #{$0} \e[1mkey\e[0m=value ..."
    	puts "  \e[1m--list-links\e[0m or \e[1m-l\e[0m  :  List of links within a text file separated by a newline"
    	puts "\n"
    	Process.exit
    end
    
    def Download(_Links,_Answer)
    	while _Continue = _Answer
    		if _Continue.chop! == "n"
    			puts "\nGood byte.... :)\n"
    			Process.exit
    		elsif _Continue == "y"
    			_Links.each {|link|
    				puts "\n\e[1mPreparing to download, this will take a few seconds...\e[0m\n\n"
    				res=Net::HTTP.get_response(URI.parse(link))
    				url=res.body().scan(/http:\/\/rs.+\..+ /i)[0].chop.chop
    				post=Net::HTTP.post_form(URI.parse(url),{'dl.start'=>'Free'})
    				time=post.body().scan(/ ([0-9]+) minutes/i)[0].to_s.to_i
    
    				if post.body().include? "File Download | Free User"
    					body=post.body().to_s
    					time=body.scan(/var c=(\d+);/i)[0].to_s.to_i
    					size=body.scan(/ ([0-9]+) /i)[0].to_s
    					dlf=body.scan(/.+(http:\/\/rs.+\..+)\';/i)[0].to_s.chop
    					filename=dlf.reverse.split("/")[0].reverse
    					for i in 0..time
    						STDERR.print "Time for download #{time-i} seconds, size #{size} kb"
    						sleep(1)
    						STDERR.print "\r"
    					end
    
    					if not system("wget #{dlf}")
    						puts "\e[31mwget not found, this tool is recommend.\n\n\e[0m"
    						puts "\nPlease be patient, now is downloding ...\n  \e[33m#{filename}\e[0m"
    						res=Net::HTTP.get_response(URI.parse(dlf))
    						f=File.new(filename,"wb")
    						f.write(res.body())					
    					end
    
    					_Links.delete(link)
    					puts "File download Success"
    
    				elsif post.body().include? "try again in about"
    					puts "Stupid server, wait moment please.\n"
    					for i in 1..time
    						for j in 1..60
    							STDERR.print "trying now in #{time-i}:#{60-j} minutes"
    							sleep(1)
    							STDERR.print "\r"
    						end
    					end
    					puts "\nstarting download again"
    					Download(_Links,"y\n")
    				elsif post.body().include? "Your IP address"
    					puts "Server busy, wait moment please."
    					puts "trying now..."
    					Download(_Links,"y\n")
    				else
    					puts "I have any problems, please check your link manually... :("
    				end
    		}
    			Process.exit
    		elsif _Continue == "r"
    			retry
    		else
    			puts "Please 'y', 'n' or 'r' [y/n/r]? "
    		end
    	end
    end
    
    #end
    
    
    if ARGV.length == 0
    	Usage()
    else
    	ARGV.each{|arg|
    		if arg.include? "-v" or arg.include? "--version"
    			puts "\n#{$0} 1.0.0 created by jrivero (\e[32mjrivero@vive-libre.org\e[0m)\n\n"
    			Process.exit
    		elsif arg.include? "-h" or arg.include? "--help"
    			Usage()
    		elsif arg.count("=") != 1 
    				Usage()
    		elsif arg.include? "="
    			key, value =arg.split("=")
    			case key
    				when "--list-links", "-l"
    					puts "\n\e[5;37;44mChecking links....\e[0m\n\n"
    					_Links.clear
    					File.new(value).each{|line|
    						res=Net::HTTP.get_response(URI.parse("#{line}"))
    						case res
    							when Net::HTTPSuccess then
    								if res.body().include? "Error"
    									_Error=true
    									puts "[\e[31mFAIL\e[0m] #{line}"
    								else
    									puts "[\e[32m OK \e[0m] #{line}"
    									_Links.push("#{line}")
    								end
    							else
    								_Error=true
    								puts "#{line}  [\e[31mFAIL\e[0m]"
    						end
    					}
    				else
    					Usage()
    			end
    
    			if _Error
    				print "You have a some broken links\nDo you like to proced with downloads [y/n/r]? "
    				Download(_Links,STDIN.gets)
    			else
    				Download(_Links,"y\n")
    			end
    			
    		end
    	}
    end
    
  4. Disculpa por el formato, alguien sabe como ponerlo con highlight ???, y ponerlo mas descente?.

    Saludos!!

    int a;

    1. Puse un breve comentario al respecto en la nota Sobre la nueva Cofradía…

      1. Wow!, Asombroso que Rapidez, Gracia Pop. Saludos!!!!

Leave a Reply