qq flash 在线小游戏下载器
发布时间:2020-12-17 04:11:37 所属栏目:百科 来源:网络整理
导读:今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 #!/usr/bin/env ruby# ruby1.9# -*- coding: UTF-8 -*-# qq flash 在线小游戏下载器#require 'rubygems'require 'mechanize'require 'pp'#require 'wi
以下代码由PHP站长网 52php.cn收集自互联网 现在PHP站长网小编把它分享给大家,仅供参考 #!/usr/bin/env ruby # > ruby1.9 # -*- coding: UTF-8 -*- # qq flash 在线小游戏下载器 # require 'rubygems' require 'mechanize' require 'pp' #require 'win32/clipboard' Url_base = 'http://game.kid.qq.com/' Out_dir = 'G:_flv_' `md #{Out_dir}` unless Dir.exist? Out_dir s_all = %Q{ http://game.kid.qq.com/static/article/11/38311.shtml http://game.kid.qq.com/static/article/19/33519.shtml http://game.kid.qq.com/static/article/87/38087.shtml } def get_it(x) #p '2 getit ' + x.to_s if x.class == Fixnum x="http://game.kid.qq.com/static/article/#{x % 100}/#{"%05d" % x}.shtml" end if x !~ /^http/ if x =~ /d{5}/ x=x.to_i x="http://game.kid.qq.com/static/article/#{x % 100}/#{"%05d" % x}.shtml" end end `title #{x} ` p '3 getit ' + x.to_s mm = x.match(//dd/d{5}.shtml/)[0] url = Url_base + "static/article#{mm}" r_url = Regexp.escape(url) r = /<div class="StepLink">s+<span>.+?<a href=".+?">.+?</a>><a href="/">.+?</a>></span>(.+?)s+</div>/ a = Mechanize.new a.get url b = a.page.body if b.size < 3000 puts b p b.size sleep 1 return end #/static/article/14/40014.shtml tmp = b.scan(/static/article/../(d{5}).shtml"/) #pp tmp #p ' tmp.size ' + tmp.size.to_s $n = next_page = tmp.sample[0] #p '4 next_page: ' + next_page name =b.scan(r)[0][0].force_encoding('gbk') if File.exist?(Out_dir + '/' + name+'.swf') puts '5 file exist: ' + name sleep 1 return end iMyGameId = b.scan(/var iMyGameId = "(.+?)";/)[0][0].to_i u = "http://img.kid.qq.com/fileupload/flash/#{"%02d" % (iMyGameId % 100)}/#{iMyGameId}.swf" p '6 url : ' + u puts `wget #{u} -O #{Out_dir}/#{name}.swf` ; sleep 3 #p '7 np : ' + next_page return next_page end s_all.each_line{|x| next if x.chomp.empty? get_it(x.chomp) } i = 40014 100.times{ p '1 i: ' + i.to_s get_it i i = $n sleep 0.2 } 以上内容由PHP站长网【52php.cn】收集整理供大家参考研究 如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |