Skip to content

Instantly share code, notes, and snippets.

@icco
Forked from anonymous/n.rb
Created October 27, 2013 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icco/7181223 to your computer and use it in GitHub Desktop.
Save icco/7181223 to your computer and use it in GitHub Desktop.
require 'fileutils'
Dir.glob('/Volumes/Downloads/torrents/Naruto Shippuuden Season 13 720p/*mkv').sort.each do |f|
episode = (File.basename(f).scan /\d\d\d/).first
file_name = "/Volumes/TV/Naruto Shippuuden/Naruto Shippuuden 13x#{episode.to_i - 260}.mkv"
puts "#{episode}: #{f.inspect} => #{file_name.inspect}"
FileUtils.cp f, file_name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment