#!/usr/bin/env ruby require 'optiflag' require File.join(File.dirname(__FILE__), '..', 'lib', 'inspector') module AutoNZB extend OptiFlagSet flag "d" do description "Download directory path for new nzb" end optional_flag "movies" do description "Directories paths (separated by ,) with all your Movie's folders" end optional_flag 'srt' do description "Subtitle languages desired (separated by ,), ie 'fr,en'. Add 'none' at the end if you want to download movies without subtitles too. 'unknown' is always added at the end, and nzb with unknown srt are always downloaded. (Order is important to define if a nzb is needed) default: nil" end optional_flag 'imdb' do description "IMDB score limit, default: 7.0" end optional_flag 'year' do description "Movie year limit, default: 1950" value_matches ["year must be a year, like 1997", /[0-9]{4}/] end optional_flag 'age' do description "Age limit, in day, of nbz file on newzleech, default: 160" value_matches ["age must be a number", /[0-9]+/] end optional_flag "pages" do description "number page(s) parsed on newzleech, default: 2. Think to augment -age when change number of pages" value_matches ["pages must be a number", /[0-9]+/] end optional_flag "backup" do description "Backup folder path (to save a copy of all downloaded nzb files and prevent an already downloaded nzb to be re-downloaded)" end optional_flag "login" do description "Username for www.nzbs.org" end optional_flag "pass" do description "Password for www.nzbs.org" end and_process! end begin inspector = Inspector.new(ARGV.flags.d, :year => ARGV.flags.year, :imdb_score => ARGV.flags.imdb, :srt => ARGV.flags.srt, :age => ARGV.flags.age, :pages => ARGV.flags.pages, :backup_path => ARGV.flags.backup, :movie_paths => ARGV.flags.movies, :login => ARGV.flags.login, :pass => ARGV.flags.pass) rescue => e p e.to_s Inspector.growl("AutoNZB Error!", 'look into the console log') end