Created
August 25, 2012 04:34
-
-
Save noah/3460793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# | |
require 'bencode' | |
# print the list of files which are in a given directory, but not currently seeding in rtorrent | |
# | |
# This script answers the question / problem: | |
# "I have a ton of stuff downloading in rtorrent, and it's all going | |
# into one directory. What stuff from that directory can be safely | |
# moved (is no longer tied to rtorrent)?" | |
# | |
# Usage: $0 </path/to/rtorrent/.sessions/*.rtorrent> </path/to/directory_of_files> | |
# | |
seeding = ARGF.collect do |str| | |
BEncode.load(str.encode! "UTF-8", "UTF-8", :invalid => :replace)['directory'] | |
end.sort | |
dir_contents = Dir["/drum/bt/*/*"] | |
puts (dir_contents - seeding).sort | |
#puts dir_contents-seeding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment