设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1998|回复: 0
打印 上一主题 下一主题

下载臼井素材用脚本

[复制链接]

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

跳转到指定楼层
1
发表于 2014-11-23 12:08:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 taroxd 于 2016-5-1 16:25 编辑

RUBY 代码复制
  1. require 'net/http'
  2.  
  3. list = %W[
  4. rpg_actor_mv_m
  5. rpg_actor_mv_f
  6. rpg_actor_m
  7. rpg_actor_f
  8. rpg_actor_etc
  9. rpg_icon
  10. rpg_chadot4_10
  11. rpg_chadot11_20
  12. rpg_chadot21_30
  13. rpg_chadot31_40
  14. rpg_chadot41_50
  15. rpg_chadot51_60
  16. rpg_chadot61_70
  17. rpg_chadot71_80
  18. rpg_chadot81_90
  19. rpg_chadot91_100
  20. rpg_chadot101_110
  21. rpg_chadot111_120
  22. rpg_chadot121_130
  23. rpg_chadot131_140
  24. rpg_chadot141_150
  25. rpg_chadot_etc
  26. rpg_window
  27. rpg_effect
  28. rpg_map
  29. rpg_kinotake_sozai
  30. ]
  31.  
  32. def usui_scan_dl html, type, re
  33.   html.scan re do |(addr)|
  34.     addr.sub!(/\A(http:\/\/usui.moo.jp|\.)/, '')
  35.     addr.prepend '/' unless addr.start_with? '/'
  36.     data = Net::HTTP.get 'usui.moo.jp', addr
  37.     File.open("#{type}/#{File.basename addr}", 'wb') { |f| f.write data }
  38.     puts "Downloaded: #{addr}"
  39.   end
  40. end
  41.  
  42. list.each do |type|
  43.  
  44.   Dir.mkdir type unless Dir.exist? type
  45.  
  46.   html = Net::HTTP.get('usui.moo.jp', "/#{type}.html")
  47.   usui_scan_dl(html, type, /<img src=\"(.+?.png)\"/)
  48.   usui_scan_dl(html, type, /<a href=\"(.+?.zip)\"/)
  49. end
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-6-15 03:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表