3 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
4 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../app/models')
13 puts "not found arc.code: #{code}"
16 unless arc.thumbs.include?(thumb)
17 arc.thumbs << { :key => thumb.key }
20 unless thumb.arcs.include?(arc)
21 thumb.arcs << { :key => arc.key }
28 thumbs.each do |thumb|
29 # puts "# #{thumb.video_id}"
31 path_re = Regexp.new(Regexp.escape(site.url) + site.path_pattern)
32 if md = path_re.match(thumb.description)
34 code, extname = site.generate_arc_code_and_extname(name)
35 puts [ thumb.video_id, "", code ].join("\t")
39 next unless site.locked_path_pattern
40 locked_path_re = Regexp.new(Regexp.escape(site.url) + site.locked_path_pattern)
41 if md = locked_path_re.match(thumb.description)
43 code = site.generate_locked_arc_code(name)
44 puts [ thumb.video_id, "locked", code ].join("\t")