#!/usr/bin/env ruby require 'optiflag' require File.join(File.dirname(__FILE__), '..', 'lib', 'inspector') require File.join(File.dirname(__FILE__), '..', 'lib', 'nzb') 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. (Order is important to define if a nzb is needed), default: none" 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 and_process! end begin inspector = Inspector.new(ARGV.flags.movies || '', :year => ARGV.flags.year, :imdb_score => ARGV.flags.imdb, :srt => ARGV.flags.srt, :backup => ARGV.flags.backup) nzbmatrix = NZB.new(inspector, ARGV.flags.d, :age => ARGV.flags.age, :pages => ARGV.flags.pages) rescue => e Inspector.growl("AutoNZB Error!", e) end